diff options
| author | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2024-07-17 00:17:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-17 00:17:49 +0200 |
| commit | f0e6b0f1abe2ff92d8a48c6c447d2d666051a8a7 (patch) | |
| tree | 0e1a015204c9e9758487aa65875c2e633e847da5 /src/server/game/Scripting/ScriptDefines | |
| parent | bdf204f1eb0cb83cadda64dd8b0b1463b046fab4 (diff) | |
chore(Core/GameObjectAI): Cleanup register macro (#19409)
Diffstat (limited to 'src/server/game/Scripting/ScriptDefines')
| -rw-r--r-- | src/server/game/Scripting/ScriptDefines/GameObjectScript.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/server/game/Scripting/ScriptDefines/GameObjectScript.h b/src/server/game/Scripting/ScriptDefines/GameObjectScript.h index 4038eaface..418a28883a 100644 --- a/src/server/game/Scripting/ScriptDefines/GameObjectScript.h +++ b/src/server/game/Scripting/ScriptDefines/GameObjectScript.h @@ -66,23 +66,21 @@ public: virtual GameObjectAI* GetAI(GameObject* /*go*/) const { return nullptr; } }; -// Cannot be used due gob scripts not working like this template <class AI> class GenericGameObjectScript : public GameObjectScript { public: GenericGameObjectScript(char const* name) : GameObjectScript(name) { } - GameObjectAI* GetAI(GameObject* me) const override { return new AI(me); } + GameObjectAI* GetAI(GameObject* go) const override { return new AI(go); } }; #define RegisterGameObjectAI(ai_name) new GenericGameObjectScript<ai_name>(#ai_name) -// Cannot be used due gob scripts not working like this template <class AI, AI* (*AIFactory)(GameObject*)> class FactoryGameObjectScript : public GameObjectScript { public: FactoryGameObjectScript(char const* name) : GameObjectScript(name) {} - GameObjectAI* GetAI(GameObject* me) const override { return AIFactory(me); } + GameObjectAI* GetAI(GameObject* go) const override { return AIFactory(go); } }; #define RegisterGameObjectAIWithFactory(ai_name, factory_fn) new FactoryGameObjectScript<ai_name, &factory_fn>(#ai_name) |
