[7545] Fixed exploration achievements for certian areas

This commit is contained in:
DonTomika 2009-03-26 17:03:30 +01:00 committed by arrai
parent 68ec6ae8ab
commit ff0c31e103
4 changed files with 19 additions and 9 deletions

View file

@ -725,14 +725,24 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(!worldOverlayEntry) if(!worldOverlayEntry)
break; break;
int32 exploreFlag = GetAreaFlagByAreaID(worldOverlayEntry->areatableID); bool matchFound = false;
if(exploreFlag < 0) for (int i = 0; i < 3; ++i)
break; {
int32 exploreFlag = GetAreaFlagByAreaID(worldOverlayEntry->areatableID[i]);
if(exploreFlag < 0)
break;
uint32 playerIndexOffset = uint32(exploreFlag) / 32; uint32 playerIndexOffset = uint32(exploreFlag) / 32;
uint32 mask = 1<< (uint32(exploreFlag) % 32); uint32 mask = 1<< (uint32(exploreFlag) % 32);
if(GetPlayer()->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask) if(GetPlayer()->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask)
{
matchFound = true;
break;
}
}
if(matchFound)
SetCriteriaProgress(achievementCriteria, 1); SetCriteriaProgress(achievementCriteria, 1);
break; break;
} }

View file

@ -1609,7 +1609,7 @@ struct WorldSafeLocsEntry
struct WorldMapOverlayEntry struct WorldMapOverlayEntry
{ {
uint32 ID; // 0 uint32 ID; // 0
uint32 areatableID; // 2 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 // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform

View file

@ -96,4 +96,4 @@ const char VehicleEntryfmt[]="niffffiiiiiiiiffffiiiiiifffffffffffssssfifi";
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiii"; const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiii";
const char WorldMapAreaEntryfmt[]="xinxffffix"; const char WorldMapAreaEntryfmt[]="xinxffffix";
const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx"; const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx";
const char WorldMapOverlayEntryfmt[]="nxixxxxxxxxxxxxxx"; const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxxx";

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7544" #define REVISION_NR "7545"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__