aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-27 18:45:41 -0500
committermegamage <none@none>2009-04-27 18:45:41 -0500
commitf62415a30c41f94bf3ed004581633f63ea4c235e (patch)
treeb5a60e98428ff9621d47805a119eb98404d0fea6 /src
parentff69ced9fe6a289a6a5a1d8058dabe296c2a6615 (diff)
[7719] Use all existed 4 world map overlay area ids instead 3, replace values by constant for avoid problem repeat. Author: VladimirMangos
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/AchievementMgr.cpp10
-rw-r--r--src/game/DBCStores.cpp4
-rw-r--r--src/game/DBCStores.h2
-rw-r--r--src/game/DBCStructure.h18
-rw-r--r--src/game/DBCfmt.h2
5 files changed, 23 insertions, 13 deletions
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
index 35e834242af..507b3c17481 100644
--- a/src/game/AchievementMgr.cpp
+++ b/src/game/AchievementMgr.cpp
@@ -890,12 +890,16 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
break;
bool matchFound = false;
- for (int j = 0; j < 3; ++j)
+ for (int j = 0; j < MAX_WORLD_MAP_OVERLAY_AREA_IDX; ++j)
{
- int32 exploreFlag = GetAreaFlagByAreaID(worldOverlayEntry->areatableID[j]);
- if(exploreFlag < 0)
+ uint32 area_id = worldOverlayEntry->areatableID[j];
+ if(!area_id) // array have 0 only in empty tail
break;
+ int32 exploreFlag = GetAreaFlagByAreaID(area_id);
+ if(exploreFlag < 0)
+ continue;
+
uint32 playerIndexOffset = uint32(exploreFlag) / 32;
uint32 mask = 1<< (uint32(exploreFlag) % 32);
diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp
index c643dc4613a..92c0a28cff4 100644
--- a/src/game/DBCStores.cpp
+++ b/src/game/DBCStores.cpp
@@ -151,8 +151,8 @@ DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt);
-DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt);
DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore(WorldMapOverlayEntryfmt);
+DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt);
typedef std::list<std::string> StoreProblemList;
@@ -516,8 +516,8 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleStore, dbcPath,"Vehicle.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sVehicleSeatStore, dbcPath,"VehicleSeat.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldMapAreaStore, dbcPath,"WorldMapArea.dbc");
- LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldSafeLocsStore, dbcPath,"WorldSafeLocs.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldMapOverlayStore, dbcPath,"WorldMapOverlay.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sWorldSafeLocsStore, dbcPath,"WorldSafeLocs.dbc");
// error checks
if(bad_dbc_files.size() >= DBCFilesCount )
diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h
index 3c0681285d6..4d7a9324ea2 100644
--- a/src/game/DBCStores.h
+++ b/src/game/DBCStores.h
@@ -144,8 +144,8 @@ extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore;
extern DBCStorage <VehicleEntry> sVehicleStore;
extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
-extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;
extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
+extern DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore;
void LoadDBCStores(const std::string& dataPath);
diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h
index 5b165501afe..506c4efa37c 100644
--- a/src/game/DBCStructure.h
+++ b/src/game/DBCStructure.h
@@ -1653,6 +1653,18 @@ struct WorldMapAreaEntry
// int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1,x2,y1,y2 coordinates)
};
+#define MAX_WORLD_MAP_OVERLAY_AREA_IDX 4
+
+struct WorldMapOverlayEntry
+{
+ uint32 ID; // 0
+ //uint32 worldMapAreaId; // 1 idx in WorldMapArea.dbc
+ uint32 areatableID[MAX_WORLD_MAP_OVERLAY_AREA_IDX]; // 2-5
+ // 6-7 always 0, possible part of areatableID[]
+ //char* internal_name // 8
+ // 9-16 some ints
+};
+
struct WorldSafeLocsEntry
{
uint32 ID; // 0
@@ -1664,12 +1676,6 @@ struct WorldSafeLocsEntry
// 21 name flags, unused
};
-struct WorldMapOverlayEntry
-{
- uint32 ID; // 0
- uint32 areatableID[4]; // 2-5
-};
-
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
#if defined( __GNUC__ )
#pragma pack()
diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h
index 2090359768c..ea2198ef22c 100644
--- a/src/game/DBCfmt.h
+++ b/src/game/DBCfmt.h
@@ -103,7 +103,7 @@ const char TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii";
const char VehicleEntryfmt[]="niffffiiiiiiiiffffiiiiiifffffffffffssssfifi";
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiii";
const char WorldMapAreaEntryfmt[]="xinxffffix";
-const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx";
const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxxx";
+const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx";
#endif \ No newline at end of file