refactor(Core/Object): adds consistency in the use of type object check (#19671)

This commit is contained in:
Grimdhex
2024-08-25 14:57:37 +02:00
committed by GitHub
parent 61f3a631c3
commit 643362d697
189 changed files with 783 additions and 775 deletions

View File

@@ -40,7 +40,7 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O
// prepare static data
ObjectGuid sourceGUID = source ? source->GetGUID() : ObjectGuid::Empty; //some script commands doesn't have source
ObjectGuid targetGUID = target ? target->GetGUID() : ObjectGuid::Empty;
ObjectGuid ownerGUID = (source && source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : ObjectGuid::Empty;
ObjectGuid ownerGUID = (source && source->IsItem()) ? ((Item*)source)->GetOwnerGUID() : ObjectGuid::Empty;
///- Schedule script execution for all scripts in the script map
ScriptMap const* s2 = &(s->second);
@@ -75,7 +75,7 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
// prepare static data
ObjectGuid sourceGUID = source ? source->GetGUID() : ObjectGuid::Empty;
ObjectGuid targetGUID = target ? target->GetGUID() : ObjectGuid::Empty;
ObjectGuid ownerGUID = (source && source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : ObjectGuid::Empty;
ObjectGuid ownerGUID = (source && source->IsItem()) ? ((Item*)source)->GetOwnerGUID() : ObjectGuid::Empty;
ScriptAction sa;
sa.sourceGUID = sourceGUID;