Skip to content

Commit

Permalink
Remove type casting functions only available in TrinityCore
Browse files Browse the repository at this point in the history
  • Loading branch information
Shauren committed Jul 13, 2024
1 parent e3696b8 commit 7ba7506
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions LuaFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ ElunaConstrainedObjectRef<Guild> GetWeakPtrFor(Guild const* obj) { return { obj-
ElunaConstrainedObjectRef<Map> GetWeakPtrFor(Map const* obj) { return { obj->GetWeakPtr(), obj }; }
ElunaConstrainedObjectRef<Object> GetWeakPtrForObjectImpl(Object const* obj)
{
if (WorldObject const* worldObject = obj->ToWorldObject())
return { obj->GetWeakPtr(), worldObject->GetMap() };
if (obj->isType(TYPEMASK_WORLDOBJECT))
return { obj->GetWeakPtr(), static_cast<WorldObject const*>(obj)->GetMap() };

if (Item const* item = obj->ToItem())
if (Player const* player = item->GetOwner())
if (obj->GetTypeId() == TYPEID_ITEM)
if (Player const* player = static_cast<Item const*>(obj)->GetOwner())
return { obj->GetWeakPtr(), player->GetMap() };

// possibly dangerous item
Expand Down

0 comments on commit 7ba7506

Please sign in to comment.