Core/Scripts: Change PlayerScript and CreatureScript inheritance

Remove UnitScript from PlayerScript and CreatureScript classes as that's how the original system that was PR'd worked, see https://github.com/TrinityCore/TrinityCore/pull/7867 for reference.
Please note these are used as global hooks and should really just invoke stateless functions.
If you need to hook methods from PlayerScript/CreatureScript and UnitScript, just define 2 different scripts (this is how the original system worked and how it was designed to work)
This commit is contained in:
Giacomo Pozzoni authored and Ovahlord committed 2020-01-28 07:41:43 +01:00
1 parent 316986765f
commit ac8bf86755
2 files changed
+7 -15

No files matched your search

+3 -4
View File
@@ -390,7 +390,7 @@ class TC_GAME_API UnitScript : public ScriptObject
{
protected:
UnitScript(char const* name, bool addToScripts = true);
UnitScript(char const* name);
public:
// Called when a unit deals healing to another unit
@@ -412,14 +412,13 @@ class TC_GAME_API UnitScript : public ScriptObject
virtual void ModifyVehiclePassengerExitPos(Unit* /*passenger*/, Vehicle* /*vehicle*/, Position& /*pos*/) { }
};
class TC_GAME_API CreatureScript : public UnitScript
class TC_GAME_API CreatureScript : public ScriptObject
{
protected:
CreatureScript(char const* name);
public:
// Called when a CreatureAI object is needed for the creature.
virtual CreatureAI* GetAI(Creature* /*creature*/) const = 0;
};
@@ -609,7 +608,7 @@ class TC_GAME_API AchievementCriteriaScript : public ScriptObject
virtual bool OnCheck(Player* source, Unit* target) = 0;
};
class TC_GAME_API PlayerScript : public UnitScript
class TC_GAME_API PlayerScript : public ScriptObject
{
protected: