RegisterInstanceMapScript
This commit is contained in:
@@ -1483,6 +1483,16 @@ public:
|
||||
};
|
||||
#define RegisterBattlegroundMapScript(script_name, mapId) new GenericBattlegroundMapScript<script_name>(#script_name, mapId)
|
||||
|
||||
template<class Script>
|
||||
class GenericInstanceMapScript : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
GenericInstanceMapScript(char const* name, uint32 mapId) noexcept : InstanceMapScript(name, mapId) {}
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override { return new Script(map); }
|
||||
};
|
||||
#define RegisterInstanceMapScript(script_name, mapId) new GenericInstanceMapScript<script_name>(#script_name, mapId)
|
||||
|
||||
#define sScriptMgr ScriptMgr::instance()
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user