Core/Entities: Extended SpawnMask to 64 bit

This commit is contained in:
hondacrx
2018-01-06 23:43:44 -05:00
parent ff338c6532
commit befc9fcae7
16 changed files with 95 additions and 75 deletions
+7 -8
View File
@@ -724,8 +724,8 @@ namespace Game.Entities
{
SetMap(map);
if (data != null && data.phaseid != 0)
SetInPhase(data.phaseid, false, true);
if (data != null && data.phaseId != 0)
SetInPhase(data.phaseId, false, true);
if (data != null && data.phaseGroup != 0)
foreach (var ph in Global.DB2Mgr.GetPhasesForGroup(data.phaseGroup))
@@ -977,10 +977,10 @@ namespace Game.Entities
}
uint mapId = GetTransport() ? (uint)GetTransport().GetGoInfo().MoTransport.SpawnMap : GetMapId();
SaveToDB(mapId, data.spawnMask, GetPhaseMask());
SaveToDB(mapId, data.spawnMask);
}
public virtual void SaveToDB(uint mapid, uint spawnMask, uint phaseMask)
public virtual void SaveToDB(uint mapid, ulong spawnMask)
{
// update in loaded data
if (m_spawnId == 0)
@@ -1022,7 +1022,6 @@ namespace Game.Entities
// data.guid = guid must not be updated at save
data.id = GetEntry();
data.mapid = (ushort)mapid;
data.phaseMask = phaseMask;
data.displayid = displayId;
data.equipmentId = GetCurrentEquipmentId();
data.posX = GetPositionX();
@@ -1045,7 +1044,7 @@ namespace Game.Entities
data.unit_flags3 = unitFlags3;
data.dynamicflags = dynamicflags;
data.phaseid = (uint)(GetDBPhase() > 0 ? GetDBPhase() : 0);
data.phaseId = (uint)(GetDBPhase() > 0 ? GetDBPhase() : 0);
data.phaseGroup = (uint)(GetDBPhase() < 0 ? Math.Abs(GetDBPhase()) : 0);
// update in DB
@@ -1062,7 +1061,7 @@ namespace Game.Entities
stmt.AddValue(index++, GetEntry());
stmt.AddValue(index++, mapid);
stmt.AddValue(index++, spawnMask);
stmt.AddValue(index++, data.phaseid);
stmt.AddValue(index++, data.phaseId);
stmt.AddValue(index++, data.phaseGroup);
stmt.AddValue(index++, displayId);
stmt.AddValue(index++, GetCurrentEquipmentId());
@@ -1320,7 +1319,7 @@ namespace Game.Entities
m_spawnId = spawnId;
m_creatureData = data;
if (!Create(map.GenerateLowGuid(HighGuid.Creature), map, data.phaseMask, data.id, data.posX, data.posY, data.posZ, data.orientation, data))
if (!Create(map.GenerateLowGuid(HighGuid.Creature), map, PhaseMasks.Normal, data.id, data.posX, data.posY, data.posZ, data.orientation, data))
return false;
//We should set first home position, because then AI calls home movement
@@ -279,7 +279,6 @@ namespace Game.Entities
{
public uint id; // entry in creature_template
public ushort mapid;
public uint phaseMask;
public uint displayid;
public int equipmentId;
public float posX;
@@ -292,13 +291,13 @@ namespace Game.Entities
public uint curhealth;
public uint curmana;
public byte movementType;
public uint spawnMask;
public ulong spawnMask;
public ulong npcflag;
public uint unit_flags; // enum UnitFlags mask values
public uint unit_flags2; // enum UnitFlags2 mask values
public uint unit_flags3; // enum UnitFlags3 mask values
public uint dynamicflags;
public uint phaseid;
public uint phaseId;
public uint phaseGroup;
public uint ScriptId;
public bool dbData;