* Rename some more functions for consistency.

* Added missing call to FormulaScript::OnZeroDifferenceCalculation.
* Pass GridMap pointer into MapScript::OnLoadGridMap/OnUnloadGridMap.
* Fire map hooks for all map types, not only instances.

--HG--
branch : trunk
This commit is contained in:
XTZGZoReX
2010-08-07 13:07:18 +02:00
parent 9a592f44af
commit 87483be1e7
6 changed files with 77 additions and 77 deletions
+7 -9
View File
@@ -62,8 +62,7 @@ struct ScriptAction
Map::~Map()
{
if (!Instanceable())
sScriptMgr.OnDestroyMap(this);
sScriptMgr.OnDestroyMap(this);
UnloadAll();
@@ -170,10 +169,10 @@ void Map::LoadMap(int gx,int gy, bool reload)
if (GridMaps[gx][gy])
{
sLog.outDetail("Unloading previously loaded map %u before reloading.",GetId());
sScriptMgr.OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy);
delete (GridMaps[gx][gy]);
GridMaps[gx][gy]=NULL;
sScriptMgr.OnUnloadGridMap(this, gx, gy);
}
// map file name
@@ -190,7 +189,7 @@ void Map::LoadMap(int gx,int gy, bool reload)
}
delete [] tmp;
sScriptMgr.OnLoadGridMap(this, gx, gy);
sScriptMgr.OnLoadGridMap(this, GridMaps[gx][gy], gx, gy);
}
void Map::LoadMapAndVMap(int gx,int gy)
@@ -237,8 +236,7 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _par
//lets initialize visibility distance for map
Map::InitVisibilityDistance();
if (!Instanceable())
sScriptMgr.OnCreateMap(this);
sScriptMgr.OnCreateMap(this);
}
void Map::InitVisibilityDistance()
@@ -447,7 +445,7 @@ bool Map::Add(Player *player)
player->m_clientGUIDs.clear();
player->UpdateObjectVisibility(true);
sScriptMgr.OnPlayerEnter(this, player);
sScriptMgr.OnPlayerEnterMap(this, player);
return true;
}
@@ -739,7 +737,7 @@ void Map::Remove(Player *player, bool remove)
if (remove)
DeleteFromWorld(player);
sScriptMgr.OnPlayerLeave(this, player);
sScriptMgr.OnPlayerLeaveMap(this, player);
}
template<class T>