Core/Maps: Set correct phase flag from DBC when using phases.
Fixes AreaTriggers and some other things. Thanks @lehtola for the tip.
This commit is contained in:
@@ -58,6 +58,7 @@ static WMOAreaInfoByTripple sWMOAreaInfoByTripple;
|
||||
DBCStorage <AchievementEntry> sAchievementStore(Achievementfmt);
|
||||
DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore(AchievementCriteriafmt);
|
||||
DBCStorage <AreaTriggerEntry> sAreaTriggerStore(AreaTriggerEntryfmt);
|
||||
DBCStorage <PhaseEntry> sPhaseStore(PhaseEntryfmt);
|
||||
DBCStorage <ArmorLocationEntry> sArmorLocationStore(ArmorLocationfmt);
|
||||
DBCStorage <AuctionHouseEntry> sAuctionHouseStore(AuctionHouseEntryfmt);
|
||||
DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt);
|
||||
@@ -328,6 +329,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc"/*, &CustomAchievementfmt, &CustomAchievementIndex*/);//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStore, dbcPath, "Phase.dbc");
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore, dbcPath, "AreaPOI.dbc");//14545
|
||||
LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");//14545
|
||||
|
||||
@@ -81,6 +81,7 @@ extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access
|
||||
extern DBCStorage <AreaGroupEntry> sAreaGroupStore;
|
||||
extern DBCStorage <AreaPOIEntry> sAreaPOIStore;
|
||||
extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore;
|
||||
extern DBCStorage <PhaseEntry> sPhaseStore;
|
||||
extern DBCStorage <ArmorLocationEntry> sArmorLocationStore;
|
||||
extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore;
|
||||
extern DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore;
|
||||
|
||||
@@ -609,6 +609,13 @@ struct AreaTriggerEntry
|
||||
float box_orientation; // 12 m_box_yaw
|
||||
};
|
||||
|
||||
struct PhaseEntry
|
||||
{
|
||||
uint32 Id;
|
||||
char* Name;
|
||||
uint32 Flag;
|
||||
}
|
||||
|
||||
struct ArmorLocationEntry
|
||||
{
|
||||
uint32 InventoryType; // 0
|
||||
|
||||
@@ -30,6 +30,7 @@ char const AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx";
|
||||
char const AreaGroupEntryfmt[]="niiiiiii";
|
||||
char const AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx";
|
||||
char const AreaTriggerEntryfmt[]="nifffxxxfffff";
|
||||
char const PhaseEntryfmt[]="isi";
|
||||
char const ArmorLocationfmt[]="nfffff";
|
||||
char const AuctionHouseEntryfmt[]="niiix";
|
||||
char const BankBagSlotPricesEntryfmt[]="ni";
|
||||
|
||||
@@ -1756,7 +1756,12 @@ void WorldSession::SendSetPhaseShift(std::set<uint32> const& phaseIds, std::set<
|
||||
|
||||
data.WriteByteSeq(guid[1]);
|
||||
|
||||
data << uint32(0); // flags (not phasemask)
|
||||
uint32 flag = 8;
|
||||
for (std::set<uint32>::const_iterator itr = phaseIds.begin(); itr != phaseIds.end(); ++itr)
|
||||
if (PhaseEntry const* phaseEntry = sPhaseStore.LookupEntry(*itr))
|
||||
flag |= phaseEntry->Flag;
|
||||
|
||||
data << uint32(flag); // flags (not phasemask)
|
||||
|
||||
data.WriteByteSeq(guid[2]);
|
||||
data.WriteByteSeq(guid[6]);
|
||||
|
||||
Reference in New Issue
Block a user