mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 01:37:00 +00:00
[12631] Use uint32 for phaseMasks in core and database
This commit is contained in:
parent
1fa3b614ed
commit
1cd806c02e
10 changed files with 15 additions and 18 deletions
|
|
@ -181,3 +181,4 @@ void PG_Escape_Str(string& str)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ void Corpse::SaveToDB()
|
||||||
<< uint64(m_time) << ", "
|
<< uint64(m_time) << ", "
|
||||||
<< uint32(GetType()) << ", "
|
<< uint32(GetType()) << ", "
|
||||||
<< int(GetInstanceId()) << ", "
|
<< int(GetInstanceId()) << ", "
|
||||||
<< uint16(GetPhaseMask()) << ")"; // prevent out of range error
|
<< uint32(GetPhaseMask()) << ")"; // prevent out of range error
|
||||||
CharacterDatabase.Execute(ss.str().c_str());
|
CharacterDatabase.Execute(ss.str().c_str());
|
||||||
CharacterDatabase.CommitTransaction();
|
CharacterDatabase.CommitTransaction();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1139,7 +1139,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||||
<< data.id << ","
|
<< data.id << ","
|
||||||
<< data.mapid << ","
|
<< data.mapid << ","
|
||||||
<< uint32(data.spawnMask) << "," // cast to prevent save as symbol
|
<< uint32(data.spawnMask) << "," // cast to prevent save as symbol
|
||||||
<< uint16(data.phaseMask) << "," // prevent out of range error
|
<< uint32(data.phaseMask) << "," // prevent out of range error
|
||||||
<< data.modelid_override << ","
|
<< data.modelid_override << ","
|
||||||
<< data.equipmentId << ","
|
<< data.equipmentId << ","
|
||||||
<< data.posX << ","
|
<< data.posX << ","
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ struct CreatureData
|
||||||
{
|
{
|
||||||
uint32 id; // entry in creature_template
|
uint32 id; // entry in creature_template
|
||||||
uint16 mapid;
|
uint16 mapid;
|
||||||
uint16 phaseMask;
|
uint32 phaseMask;
|
||||||
uint32 modelid_override; // overrides any model defined in creature_template
|
uint32 modelid_override; // overrides any model defined in creature_template
|
||||||
int32 equipmentId;
|
int32 equipmentId;
|
||||||
float posX;
|
float posX;
|
||||||
|
|
|
||||||
|
|
@ -567,7 +567,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||||
<< GetEntry() << ", "
|
<< GetEntry() << ", "
|
||||||
<< mapid << ", "
|
<< mapid << ", "
|
||||||
<< uint32(spawnMask) << "," // cast to prevent save as symbol
|
<< uint32(spawnMask) << "," // cast to prevent save as symbol
|
||||||
<< uint16(GetPhaseMask()) << "," // prevent out of range error
|
<< uint32(GetPhaseMask()) << "," // prevent out of range error
|
||||||
<< GetPositionX() << ", "
|
<< GetPositionX() << ", "
|
||||||
<< GetPositionY() << ", "
|
<< GetPositionY() << ", "
|
||||||
<< GetPositionZ() << ", "
|
<< GetPositionZ() << ", "
|
||||||
|
|
|
||||||
|
|
@ -585,7 +585,7 @@ struct GameObjectData
|
||||||
{
|
{
|
||||||
uint32 id; // entry in gamobject_template
|
uint32 id; // entry in gamobject_template
|
||||||
uint16 mapid;
|
uint16 mapid;
|
||||||
uint16 phaseMask;
|
uint32 phaseMask;
|
||||||
float posX;
|
float posX;
|
||||||
float posY;
|
float posY;
|
||||||
float posZ;
|
float posZ;
|
||||||
|
|
|
||||||
|
|
@ -1262,7 +1262,7 @@ void ObjectMgr::LoadCreatures()
|
||||||
data.is_dead = fields[14].GetBool();
|
data.is_dead = fields[14].GetBool();
|
||||||
data.movementType = fields[15].GetUInt8();
|
data.movementType = fields[15].GetUInt8();
|
||||||
data.spawnMask = fields[16].GetUInt8();
|
data.spawnMask = fields[16].GetUInt8();
|
||||||
data.phaseMask = fields[17].GetUInt16();
|
data.phaseMask = fields[17].GetUInt32();
|
||||||
int16 gameEvent = fields[18].GetInt16();
|
int16 gameEvent = fields[18].GetInt16();
|
||||||
int16 GuidPoolId = fields[19].GetInt16();
|
int16 GuidPoolId = fields[19].GetInt16();
|
||||||
int16 EntryPoolId = fields[20].GetInt16();
|
int16 EntryPoolId = fields[20].GetInt16();
|
||||||
|
|
@ -1492,7 +1492,7 @@ void ObjectMgr::LoadGameObjects()
|
||||||
data.animprogress = fields[12].GetUInt32();
|
data.animprogress = fields[12].GetUInt32();
|
||||||
uint32 go_state = fields[13].GetUInt32();
|
uint32 go_state = fields[13].GetUInt32();
|
||||||
data.spawnMask = fields[14].GetUInt8();
|
data.spawnMask = fields[14].GetUInt8();
|
||||||
data.phaseMask = fields[15].GetUInt16();
|
data.phaseMask = fields[15].GetUInt32();
|
||||||
int16 gameEvent = fields[16].GetInt16();
|
int16 gameEvent = fields[16].GetInt16();
|
||||||
int16 GuidPoolId = fields[17].GetInt16();
|
int16 GuidPoolId = fields[17].GetInt16();
|
||||||
int16 EntryPoolId = fields[18].GetInt16();
|
int16 EntryPoolId = fields[18].GetInt16();
|
||||||
|
|
|
||||||
|
|
@ -597,25 +597,21 @@ void WorldSession::SendSetPhaseShift(uint32 phaseMask, uint16 mapId)
|
||||||
data.WriteGuidMask<2, 3, 1, 6, 4, 5, 0, 7>(guid);
|
data.WriteGuidMask<2, 3, 1, 6, 4, 5, 0, 7>(guid);
|
||||||
data.WriteGuidBytes<7, 4>(guid);
|
data.WriteGuidBytes<7, 4>(guid);
|
||||||
|
|
||||||
// Seen only 0 bytes
|
data << uint32(0); // number of WorldMapArea.dbc entries to control world map shift * 2
|
||||||
data << uint32(0);
|
|
||||||
|
|
||||||
data.WriteGuidBytes<1>(guid);
|
data.WriteGuidBytes<1>(guid);
|
||||||
data << uint32(phaseMask ? phaseFlags : 8);
|
data << uint32(phaseMask ? phaseFlags : 8);
|
||||||
data.WriteGuidBytes<2, 6>(guid);
|
data.WriteGuidBytes<2, 6>(guid);
|
||||||
|
|
||||||
// Seen only 0 bytes
|
data << uint32(0); // number of inactive terrain swaps * 2
|
||||||
data << uint32(0);
|
|
||||||
|
|
||||||
// PhaseShift, uint16 (2 bytes)
|
data << uint32(phaseMask ? 2 : 0); // WRONG: number of Phase.dbc ids * 2
|
||||||
data << uint32(phaseMask ? 2 : 0);
|
|
||||||
if (phaseMask)
|
if (phaseMask)
|
||||||
data << uint16(phaseMask);
|
data << uint16(phaseMask);
|
||||||
|
|
||||||
data.WriteGuidBytes<3, 0>(guid);
|
data.WriteGuidBytes<3, 0>(guid);
|
||||||
|
|
||||||
// MapId , uint16 (2 bytes)
|
data << uint32(mapId ? 2 : 0); // number of terrains swaps * 2
|
||||||
data << uint32(mapId ? 2 : 0);
|
|
||||||
if (mapId)
|
if (mapId)
|
||||||
data << uint16(mapId);
|
data << uint16(mapId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "12630"
|
#define REVISION_NR "12631"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __REVISION_SQL_H__
|
#ifndef __REVISION_SQL_H__
|
||||||
#define __REVISION_SQL_H__
|
#define __REVISION_SQL_H__
|
||||||
#define REVISION_DB_CHARACTERS "required_12447_02_characters_calendar_invites"
|
#define REVISION_DB_CHARACTERS "required_c12631_01_characters_corpse"
|
||||||
#define REVISION_DB_MANGOS "required_12602_01_mangos_npc_spellclick_spells"
|
#define REVISION_DB_MANGOS "required_c12631_02_mangos_gameobject"
|
||||||
#define REVISION_DB_REALMD "required_c12484_02_realmd_account_access"
|
#define REVISION_DB_REALMD "required_c12484_02_realmd_account_access"
|
||||||
#endif // __REVISION_SQL_H__
|
#endif // __REVISION_SQL_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue