From a4eab7e9f2fabee2ff58f1b8f9e7c4ef7bac359a Mon Sep 17 00:00:00 2001 From: Ambal Date: Mon, 11 May 2009 12:59:25 +0400 Subject: [PATCH] [7811] do not reload already loaded map coordinats at runtime. Signed-off-by: AlexDereka --- src/game/Map.cpp | 5 ++++- src/game/Map.h | 2 +- src/shared/revision_nr.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 2813d50db..e3cf0164b 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -117,7 +117,7 @@ void Map::LoadVMap(int gx,int gy) } } -void Map::LoadMap(int gx,int gy) +void Map::LoadMap(int gx,int gy, bool reload) { if( i_InstanceId != 0 ) { @@ -135,6 +135,9 @@ void Map::LoadMap(int gx,int gy) return; } + if(GridMaps[gx][gy] && !reload) + return; + //map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?) if(GridMaps[gx][gy]) { diff --git a/src/game/Map.h b/src/game/Map.h index dd300366c..a07553181 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -404,7 +404,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj private: void LoadMapAndVMap(int gx, int gy); void LoadVMap(int gx, int gy); - void LoadMap(int gx,int gy); + void LoadMap(int gx,int gy, bool reload = false); GridMap *GetGrid(float x, float y); void SetTimer(uint32 t) { i_gridExpiry = t < MIN_GRID_DELAY ? MIN_GRID_DELAY : t; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c72f72a49..1665e0d56 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7810" + #define REVISION_NR "7811" #endif // __REVISION_NR_H__