mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-14 07:53:44 +00:00
feat(Core/Maps): Improve map object updater (#22392)
This commit is contained in:
@@ -3076,3 +3076,21 @@ std::string GameObject::GetDebugInfo() const
|
||||
<< "SpawnId: " << GetSpawnId() << " GoState: " << std::to_string(GetGoState()) << " ScriptId: " << GetScriptId() << " AIName: " << GetAIName();
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
// Note: This is called in a tight (heavy) loop, is it critical that all checks are FAST and are hopefully only simple conditionals.
|
||||
bool GameObject::IsUpdateNeeded()
|
||||
{
|
||||
if (WorldObject::IsUpdateNeeded())
|
||||
return true;
|
||||
|
||||
if (GetMap()->isCellMarked(GetCurrentCell().GetCellCoord().GetId()))
|
||||
return true;
|
||||
|
||||
if (IsVisibilityOverridden())
|
||||
return true;
|
||||
|
||||
if (IsTransport())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ enum LootState
|
||||
// 5 sec for bobber catch
|
||||
#define FISHING_BOBBER_READY_TIME 5
|
||||
|
||||
class GameObject : public WorldObject, public GridObject<GameObject>, public MovableMapObject
|
||||
class GameObject : public WorldObject, public GridObject<GameObject>, public MovableMapObject, public UpdatableMapObject
|
||||
{
|
||||
public:
|
||||
explicit GameObject();
|
||||
@@ -362,6 +362,8 @@ public:
|
||||
void SaveStateToDB();
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
bool IsUpdateNeeded() override;
|
||||
protected:
|
||||
bool AIM_Initialize();
|
||||
GameObjectModel* CreateModel();
|
||||
|
||||
Reference in New Issue
Block a user