Fixed a bug that caused the server to crash when removing a player's.. (#152)

.. insigna, as a Rogue.
This commit is contained in:
Tristan 'Natrist' Cormier 2021-05-18 15:47:06 -04:00 committed by GitHub
parent 1560be33b6
commit 201bded3ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,15 +255,26 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recv_data*/)
break;
}
case HIGHGUID_CORPSE: // remove insignia ONLY in BG
/* HACK: Due to the spaghetti code below, */
/* we have a special case here for the looting of player corpses in battlegrounds. */
case HIGHGUID_CORPSE:
{
Corpse* bones = _player->GetMap()->GetCorpse(guid);
if (bones && bones->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
{
pLoot = &bones->loot;
}
pLoot->NotifyMoneyRemoved();
player->ModifyMoney(pLoot->gold);
// Used by Eluna
#ifdef ENABLE_ELUNA
sEluna->OnLootMoney(player, pLoot->gold);
#endif /* ENABLE_ELUNA */
pLoot->gold = 0;
return;
}
break;
}
case HIGHGUID_ITEM: