aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting/ScriptMgr.h
diff options
context:
space:
mode:
authorclick <none@none>2010-08-07 14:57:54 +0200
committerclick <none@none>2010-08-07 14:57:54 +0200
commitf2ddd5d067671907460c37d2026be59a95c535ea (patch)
treeb83686a504ff0ff3543a1d79edc4f719c67944d0 /src/server/game/Scripting/ScriptMgr.h
parent31887e64178d532056cb0cf55b11dfa70c697ee7 (diff)
Force script-template to build nicely under GCC (thanks to Machiavelli and Zor)
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.h')
-rw-r--r--src/server/game/Scripting/ScriptMgr.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index e735c7b9765..fd54174fe3f 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -381,7 +381,7 @@ class WorldMapScript : public ScriptObject, public MapScript<Map>
protected:
WorldMapScript(const char* name, uint32 mapId)
- : ScriptObject(name), MapScript(mapId)
+ : ScriptObject(name), MapScript<Map>(mapId)
{
if (GetEntry() && !GetEntry()->IsContinent())
sLog.outError("WorldMapScript for map %u is invalid.", mapId);
@@ -395,7 +395,7 @@ class InstanceMapScript : public ScriptObject, public MapScript<InstanceMap>
protected:
InstanceMapScript(const char* name, uint32 mapId = 0)
- : ScriptObject(name), MapScript(mapId)
+ : ScriptObject(name), MapScript<InstanceMap>(mapId)
{
if (GetEntry() && !GetEntry()->IsDungeon())
sLog.outError("InstanceMapScript for map %u is invalid.", mapId);
@@ -416,7 +416,7 @@ class BattlegroundMapScript : public ScriptObject, public MapScript<BattleGround
protected:
BattlegroundMapScript(const char* name, uint32 mapId)
- : ScriptObject(name), MapScript(mapId)
+ : ScriptObject(name), MapScript<BattleGroundMap>(mapId)
{
if (GetEntry() && !GetEntry()->IsBattleGround())
sLog.outError("BattlegroundMapScript for map %u is invalid.", mapId);
@@ -910,30 +910,30 @@ class ScriptMgr
public: /* ScriptRegistry */
- // This is the global static registry of scripts.
- template<class TScript> class ScriptRegistry
+ template<class TScript>
+ class ScriptRegistry
{
// Counter used for code-only scripts.
- static uint32 _scriptIdCounter;
-
+ static int _scriptIdCounter;
+
public:
-
- typedef std::map<uint32, TScript*> ScriptMap;
-
+
+ typedef std::map<int, TScript*> ScriptMap;
+
// The actual list of scripts. This will be accessed concurrently, so it must not be modified
// after server startup.
static ScriptMap ScriptPointerList;
-
+
// Gets a script by its ID (assigned by ObjectMgr).
- static TScript* GetScriptById(uint32 id)
+ static TScript* GetScriptById(int id)
{
- ScriptMap::iterator it = ScriptPointerList.find(id);
- if (it == ScriptPointerList.end())
- return NULL;
-
- return it->second;
+ ScriptMap it = ScriptPointerList.find(id);
+ if (it != ScriptPointerList.end())
+ return it->second;
+
+ return NULL;
}
-
+
// Attempts to add a new script to the list.
static void AddScript(TScript* const script);
};