[DiscordArchive] ```cpp
[DiscordArchive] ```cpp
Archived author: caweren • Posted: 2025-02-10T16:30:05.660000+00:00
Original source
```cpp
// caster is Player*
// target is Item*
caster->DestroyItem(target->GetBagSlot(), target->GetSlot(), true);
```
Can someone tell me why the above code crashes my worldserver on the next `SaveInventoryToDB()` call?
I have tried to look around on how the core uses `DestroyItem` in other places, and they all seem to do the same as I?
Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:07.783000+00:00
Original source
<:wHaT:585568060992126976>
Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:21.168000+00:00
Original source
I must be tired <:KEKW:715590037235957890>
Archived author: Harbynger • Posted: 2020-08-01T15:42:42.559000+00:00
Original source
If it's just snprintf under the hood there's a way to break it and have it incorrectly parse a string as an integer and lead to SQL injection
Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:57.929000+00:00
Original source
Look at how `PQuery` works <:pepocozy:638459688807301141>
Archived author: MaxtorCoder • Posted: 2020-08-01T15:43:02.184000+00:00
Original source
And yes, honestly that is a bad way,.
Archived author: Harbynger • Posted: 2020-08-01T15:43:23.733000+00:00
Original source
yeah that's what im saying, i dont know what it does, but that'd be what i'd personally worry about
Archived author: Harbynger • Posted: 2020-08-01T15:43:29.755000+00:00
Original source
Maybe its fine
Archived author: Harbynger • Posted: 2020-08-01T15:44:17.743000+00:00
Original source
but the whole ahead-of-time variable declaration spam seems like someone trying really hard to write K&R but it's C++
Archived author: Harbynger • Posted: 2020-08-01T15:44:39.670000+00:00
Original source
we have more than 4kb memory now, no need for that stuff anymore