mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Make use of new ToItem() casts
--HG-- branch : trunk
This commit is contained in:
@@ -101,7 +101,7 @@ Object::~Object()
|
||||
{
|
||||
sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
|
||||
if (isType(TYPEMASK_ITEM))
|
||||
sLog.outCrash("Item slot %u", ((Item*)this)->GetSlot());
|
||||
sLog.outCrash("Item slot %u", this->ToItem()->GetSlot());
|
||||
ASSERT(false);
|
||||
RemoveFromWorld();
|
||||
}
|
||||
|
||||
@@ -2800,7 +2800,7 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O
|
||||
// prepare static data
|
||||
uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; //some script commands doesn't have source
|
||||
uint64 targetGUID = target ? target->GetGUID() : (uint64)0;
|
||||
uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0;
|
||||
uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? source->ToItem()->GetOwnerGUID() : (uint64)0;
|
||||
|
||||
///- Schedule script execution for all scripts in the script map
|
||||
ScriptMap const *s2 = &(s->second);
|
||||
@@ -2835,7 +2835,7 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
|
||||
// prepare static data
|
||||
uint64 sourceGUID = source ? source->GetGUID() : (uint64)0;
|
||||
uint64 targetGUID = target ? target->GetGUID() : (uint64)0;
|
||||
uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0;
|
||||
uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? source->ToItem()->GetOwnerGUID() : (uint64)0;
|
||||
|
||||
ScriptAction sa;
|
||||
sa.sourceGUID = sourceGUID;
|
||||
|
||||
@@ -193,13 +193,13 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
{
|
||||
sScriptMgr.ItemQuestAccept(_player, ((Item*)pObject), qInfo);
|
||||
sScriptMgr.ItemQuestAccept(_player, pObject->ToItem(), qInfo);
|
||||
|
||||
// destroy not required for quest finish quest starting item
|
||||
bool destroyItem = true;
|
||||
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
if ((qInfo->ReqItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetProto()->MaxCount > 0))
|
||||
if (qInfo->ReqItemId[i] == pObject->ToItem()->GetEntry() && pObject->ToItem()->GetProto()->MaxCount > 0)
|
||||
{
|
||||
destroyItem = false;
|
||||
break;
|
||||
@@ -207,7 +207,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
if (destroyItem)
|
||||
_player->DestroyItem(((Item*)pObject)->GetBagSlot(),((Item*)pObject)->GetSlot(),true);
|
||||
_player->DestroyItem(pObject->ToItem()->GetBagSlot(), pObject->ToItem()->GetSlot(),true);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user