Core/Battlefields: Refactor Battlefield creation to be linked to host map creation instead of having globally accessible objects
This commit is contained in:
1 parent
28ad85c160
commit
265c2fa508
22 files changed
+253
-192
No files matched your search
@@ -1573,10 +1573,10 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
return tmpscript->OnTrigger(player, trigger);
|
||||
}
|
||||
|
||||
Battlefield* ScriptMgr::CreateBattlefield(uint32 scriptId)
|
||||
Battlefield* ScriptMgr::CreateBattlefield(uint32 scriptId, Map* map)
|
||||
{
|
||||
GET_SCRIPT_RET(BattlefieldScript, scriptId, tmpscript, nullptr);
|
||||
return tmpscript->GetBattlefield();
|
||||
return tmpscript->GetBattlefield(map);
|
||||
}
|
||||
|
||||
Battleground* ScriptMgr::CreateBattleground(BattlegroundTypeId /*typeId*/)
|
||||
|
||||
@@ -462,7 +462,7 @@ class TC_GAME_API BattlefieldScript : public ScriptObject
|
||||
|
||||
public:
|
||||
|
||||
virtual Battlefield* GetBattlefield() const = 0;
|
||||
virtual Battlefield* GetBattlefield(Map* map) const = 0;
|
||||
};
|
||||
|
||||
class TC_GAME_API BattlegroundScript : public ScriptObject
|
||||
@@ -948,7 +948,7 @@ class TC_GAME_API ScriptMgr
|
||||
|
||||
public: /* BattlefieldScript */
|
||||
|
||||
Battlefield* CreateBattlefield(uint32 scriptId);
|
||||
Battlefield* CreateBattlefield(uint32 scriptId, Map* map);
|
||||
|
||||
public: /* BattlegroundScript */
|
||||
|
||||
|
||||
Reference in new issue
Block a user