mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 04:32:35 -04:00
Core/Entities: Use ObjectGuid class in game project
This commit is contained in:
@@ -558,10 +558,10 @@ public:
|
||||
for (uint8 j = 0; j < bag->GetBagSize(); ++j)
|
||||
if (Item* item2 = bag->GetItemByPos(j))
|
||||
if (item2->GetState() == state)
|
||||
handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item2->GetSlot(), item2->GetGUIDLow(), GUID_LOPART(item2->GetOwnerGUID()));
|
||||
handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item2->GetSlot(), item2->GetGUIDLow(), item2->GetOwnerGUID().GetCounter());
|
||||
}
|
||||
else if (item->GetState() == state)
|
||||
handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item->GetSlot(), item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID()));
|
||||
handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item->GetSlot(), item->GetGUIDLow(), item->GetOwnerGUID().GetCounter());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -623,7 +623,7 @@ public:
|
||||
|
||||
if (item->GetOwnerGUID() != player->GetGUID())
|
||||
{
|
||||
handler->PSendSysMessage("The item with slot %d and itemguid %d does have non-matching owner guid (%d) and player guid (%d) !", item->GetSlot(), item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID()), player->GetGUIDLow());
|
||||
handler->PSendSysMessage("The item with slot %d and itemguid %d does have non-matching owner guid (%d) and player guid (%d) !", item->GetSlot(), item->GetGUIDLow(), item->GetOwnerGUID().GetCounter(), player->GetGUIDLow());
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
@@ -683,7 +683,7 @@ public:
|
||||
|
||||
if (item2->GetOwnerGUID() != player->GetGUID())
|
||||
{
|
||||
handler->PSendSysMessage("The item in bag %d at slot %d and with itemguid %d, the owner's guid (%d) and the player's guid (%d) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUIDLow(), GUID_LOPART(item2->GetOwnerGUID()), player->GetGUIDLow());
|
||||
handler->PSendSysMessage("The item in bag %d at slot %d and with itemguid %d, the owner's guid (%d) and the player's guid (%d) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUIDLow(), item2->GetOwnerGUID().GetCounter(), player->GetGUIDLow());
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
@@ -745,7 +745,7 @@ public:
|
||||
|
||||
if (item->GetOwnerGUID() != player->GetGUID())
|
||||
{
|
||||
handler->PSendSysMessage("queue(%zu): For the item with guid %d, the owner's guid (%d) and the player's guid (%d) don't match!", i, item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID()), player->GetGUIDLow());
|
||||
handler->PSendSysMessage("queue(%zu): For the item with guid %d, the owner's guid (%d) and the player's guid (%d) don't match!", i, item->GetGUIDLow(), item->GetOwnerGUID().GetCounter(), player->GetGUIDLow());
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
@@ -972,7 +972,7 @@ public:
|
||||
uint32 guid = (uint32)atoi(e);
|
||||
uint32 index = (uint32)atoi(f);
|
||||
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, guid));
|
||||
|
||||
if (!i)
|
||||
return false;
|
||||
@@ -1003,7 +1003,7 @@ public:
|
||||
uint32 index = (uint32)atoi(f);
|
||||
uint32 value = (uint32)atoi(g);
|
||||
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, 0, guid));
|
||||
|
||||
if (!i)
|
||||
return false;
|
||||
@@ -1027,7 +1027,7 @@ public:
|
||||
|
||||
uint32 guid = (uint32)atoi(e);
|
||||
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM));
|
||||
Item* i = handler->GetSession()->GetPlayer()->GetItemByGuid(ObjectGuid(HIGHGUID_ITEM, guid));
|
||||
|
||||
if (!i)
|
||||
return false;
|
||||
@@ -1106,12 +1106,12 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64 guid = target->GetGUID();
|
||||
ObjectGuid guid = target->GetGUID();
|
||||
|
||||
uint32 field = (uint32)atoi(x);
|
||||
if (field >= target->GetValuesCount())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, field, GUID_LOPART(guid), target->GetValuesCount());
|
||||
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, field, guid.GetCounter(), target->GetValuesCount());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1123,13 +1123,13 @@ public:
|
||||
{
|
||||
uint32 value = (uint32)atoi(y);
|
||||
target->SetUInt32Value(field, value);
|
||||
handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), field, value);
|
||||
handler->PSendSysMessage(LANG_SET_UINT_FIELD, guid.GetCounter(), field, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
float value = (float)atof(y);
|
||||
target->SetFloatValue(field, value);
|
||||
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), field, value);
|
||||
handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, guid.GetCounter(), field, value);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1154,12 +1154,12 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64 guid = target->GetGUID();
|
||||
ObjectGuid guid = target->GetGUID();
|
||||
|
||||
uint32 opcode = (uint32)atoi(x);
|
||||
if (opcode >= target->GetValuesCount())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, opcode, GUID_LOPART(guid), target->GetValuesCount());
|
||||
handler->PSendSysMessage(LANG_TOO_BIG_INDEX, opcode, guid.GetCounter(), target->GetValuesCount());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1170,12 +1170,12 @@ public:
|
||||
if (isInt32)
|
||||
{
|
||||
uint32 value = target->GetUInt32Value(opcode);
|
||||
handler->PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), opcode, value);
|
||||
handler->PSendSysMessage(LANG_GET_UINT_FIELD, guid.GetCounter(), opcode, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
float value = target->GetFloatValue(opcode);
|
||||
handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), opcode, value);
|
||||
handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, guid.GetCounter(), opcode, value);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user