Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Can you help me, please?

[DiscordArchive] Can you help me, please?

[DiscordArchive] Can you help me, please?

Pages (8): Previous 1 4 5 6 7 8 Next  
rektbyfaith
Administrator
0
03-16-2024, 01:32 AM
#61
Archived author: Nyeriah • Posted: 2024-03-16T01:32:42.020000+00:00
Original source

rektbyfaith
03-16-2024, 01:32 AM #61

Archived author: Nyeriah • Posted: 2024-03-16T01:32:42.020000+00:00
Original source

rektbyfaith
Administrator
0
03-16-2024, 01:36 AM
#62
Archived author: Foe • Posted: 2024-03-16T01:36:35.269000+00:00
Original source

Just don't fetch the player object twice
rektbyfaith
03-16-2024, 01:36 AM #62

Archived author: Foe • Posted: 2024-03-16T01:36:35.269000+00:00
Original source

Just don't fetch the player object twice

rektbyfaith
Administrator
0
03-16-2024, 01:36 AM
#63
Archived author: Foe • Posted: 2024-03-16T01:36:51.703000+00:00
Original source

It makes no sense to get the player at the top of the script, and then again further down
rektbyfaith
03-16-2024, 01:36 AM #63

Archived author: Foe • Posted: 2024-03-16T01:36:51.703000+00:00
Original source

It makes no sense to get the player at the top of the script, and then again further down

rektbyfaith
Administrator
0
03-16-2024, 01:44 AM
#64
Archived author: Nyeriah • Posted: 2024-03-16T01:44:48.381000+00:00
Original source

it does because one is the sender and the other is the receiver
rektbyfaith
03-16-2024, 01:44 AM #64

Archived author: Nyeriah • Posted: 2024-03-16T01:44:48.381000+00:00
Original source

it does because one is the sender and the other is the receiver

rektbyfaith
Administrator
0
03-16-2024, 01:45 AM
#65
Archived author: Nyeriah • Posted: 2024-03-16T01:45:50.225000+00:00
Original source

code is bad but its 11pm so no way im bothering with it past the crash fix at this time
rektbyfaith
03-16-2024, 01:45 AM #65

Archived author: Nyeriah • Posted: 2024-03-16T01:45:50.225000+00:00
Original source

code is bad but its 11pm so no way im bothering with it past the crash fix at this time

rektbyfaith
Administrator
0
03-16-2024, 01:47 AM
#66
Archived author: Nyeriah • Posted: 2024-03-16T01:47:16.200000+00:00
Original source

it was crashing because it tried to get the player sender when the command is used from console (session is nullptr)
rektbyfaith
03-16-2024, 01:47 AM #66

Archived author: Nyeriah • Posted: 2024-03-16T01:47:16.200000+00:00
Original source

it was crashing because it tried to get the player sender when the command is used from console (session is nullptr)

rektbyfaith
Administrator
0
03-16-2024, 01:51 AM
#67
Archived author: Foe • Posted: 2024-03-16T01:51:17.120000+00:00
Original source

But why do you need to know the sender? The only reason you need to know the sender is whether or not they are a GM to remove the bind flag, but only if the sender *is* the receiver
rektbyfaith
03-16-2024, 01:51 AM #67

Archived author: Foe • Posted: 2024-03-16T01:51:17.120000+00:00
Original source

But why do you need to know the sender? The only reason you need to know the sender is whether or not they are a GM to remove the bind flag, but only if the sender *is* the receiver

rektbyfaith
Administrator
0
03-16-2024, 01:51 AM
#68
Archived author: Foe • Posted: 2024-03-16T01:51:32.572000+00:00
Original source

So by that logic, you only have to remove the flag if the receiver is a GM
rektbyfaith
03-16-2024, 01:51 AM #68

Archived author: Foe • Posted: 2024-03-16T01:51:32.572000+00:00
Original source

So by that logic, you only have to remove the flag if the receiver is a GM

rektbyfaith
Administrator
0
03-16-2024, 01:52 AM
#69
Archived author: Foe • Posted: 2024-03-16T01:52:45.652000+00:00
Original source

The sender in this case is completely useless ‍♂️
rektbyfaith
03-16-2024, 01:52 AM #69

Archived author: Foe • Posted: 2024-03-16T01:52:45.652000+00:00
Original source

The sender in this case is completely useless ‍♂️

rektbyfaith
Administrator
0
03-16-2024, 01:54 AM
#70
Archived author: Foe • Posted: 2024-03-16T01:54:10.446000+00:00
Original source

```C++
// Adding items
uint32 noSpaceForCount = 0;

// check space and find places
ItemPosCountVec dest;
InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount);

if (msg != EQUIP_ERR_OK) // convert to possible store amount
count -= noSpaceForCount;

if (!count || dest.empty()) // can't add any
{
handler->SendErrorMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
return false;
}

Item* item = playerTarget->StoreNewItem(dest, itemId, true);
if (!item)
return false;

playerTarget->SendNewItem(item, count, true, false);

if (playerTarget->GetSession()->GetSecurity() > SEC_PLAYER)
item->SetBinding(false);

if (noSpaceForCount)
handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);

return true;```
rektbyfaith
03-16-2024, 01:54 AM #70

Archived author: Foe • Posted: 2024-03-16T01:54:10.446000+00:00
Original source

```C++
// Adding items
uint32 noSpaceForCount = 0;

// check space and find places
ItemPosCountVec dest;
InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount);

if (msg != EQUIP_ERR_OK) // convert to possible store amount
count -= noSpaceForCount;

if (!count || dest.empty()) // can't add any
{
handler->SendErrorMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
return false;
}

Item* item = playerTarget->StoreNewItem(dest, itemId, true);
if (!item)
return false;

playerTarget->SendNewItem(item, count, true, false);

if (playerTarget->GetSession()->GetSecurity() > SEC_PLAYER)
item->SetBinding(false);

if (noSpaceForCount)
handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);

return true;```

Pages (8): Previous 1 4 5 6 7 8 Next  
Recently Browsing
 
Recently Browsing