Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] ```cpp

[DiscordArchive] ```cpp

[DiscordArchive] ```cpp

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
08-01-2020, 03:41 PM
#1
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?
rektbyfaith
08-01-2020, 03:41 PM #1

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?

rektbyfaith
Administrator
0
08-01-2020, 03:42 PM
#2
Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:07.783000+00:00
Original source

<:wHaT:585568060992126976>
rektbyfaith
08-01-2020, 03:42 PM #2

Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:07.783000+00:00
Original source

<:wHaT:585568060992126976>

rektbyfaith
Administrator
0
08-01-2020, 03:42 PM
#3
Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:21.168000+00:00
Original source

I must be tired <:KEKW:715590037235957890>
rektbyfaith
08-01-2020, 03:42 PM #3

Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:21.168000+00:00
Original source

I must be tired <:KEKW:715590037235957890>

rektbyfaith
Administrator
0
08-01-2020, 03:42 PM
#4
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
rektbyfaith
08-01-2020, 03:42 PM #4

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

rektbyfaith
Administrator
0
08-01-2020, 03:42 PM
#5
Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:57.929000+00:00
Original source

Look at how `PQuery` works <:pepocozy:638459688807301141>
rektbyfaith
08-01-2020, 03:42 PM #5

Archived author: MaxtorCoder • Posted: 2020-08-01T15:42:57.929000+00:00
Original source

Look at how `PQuery` works <:pepocozy:638459688807301141>

rektbyfaith
Administrator
0
08-01-2020, 03:43 PM
#6
Archived author: MaxtorCoder • Posted: 2020-08-01T15:43:02.184000+00:00
Original source

And yes, honestly that is a bad way,.
rektbyfaith
08-01-2020, 03:43 PM #6

Archived author: MaxtorCoder • Posted: 2020-08-01T15:43:02.184000+00:00
Original source

And yes, honestly that is a bad way,.

rektbyfaith
Administrator
0
08-01-2020, 03:43 PM
#7
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
rektbyfaith
08-01-2020, 03:43 PM #7

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

rektbyfaith
Administrator
0
08-01-2020, 03:43 PM
#8
Archived author: Harbynger • Posted: 2020-08-01T15:43:29.755000+00:00
Original source

Maybe its fine
rektbyfaith
08-01-2020, 03:43 PM #8

Archived author: Harbynger • Posted: 2020-08-01T15:43:29.755000+00:00
Original source

Maybe its fine

rektbyfaith
Administrator
0
08-01-2020, 03:44 PM
#9
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++
rektbyfaith
08-01-2020, 03:44 PM #9

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++

rektbyfaith
Administrator
0
08-01-2020, 03:44 PM
#10
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
rektbyfaith
08-01-2020, 03:44 PM #10

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

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)