Core/Misc: Change creatures and gameobject phasemask from 16 to 32 bits

Signed-off-by: Nay <dnpd.dd@gmail.com>
This commit is contained in:
Vlad
2013-07-19 04:03:40 +01:00
committed by Nay
parent ebd9090d80
commit 0b9a8ccef5
11 changed files with 16 additions and 13 deletions

View File

@@ -1339,7 +1339,7 @@ CREATE TABLE `corpse` (
`posZ` float NOT NULL DEFAULT '0',
`orientation` float NOT NULL DEFAULT '0',
`mapId` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier',
`phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1',
`phaseMask` int(10) unsigned NOT NULL DEFAULT '1',
`displayId` int(10) unsigned NOT NULL DEFAULT '0',
`itemCache` text NOT NULL,
`bytes1` int(10) unsigned NOT NULL DEFAULT '0',

View File

@@ -0,0 +1 @@
ALTER TABLE `corpse` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1';

View File

@@ -0,0 +1,2 @@
ALTER TABLE `gameobject` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1';
ALTER TABLE `creature` CHANGE `phaseMask` `phaseMask` int(10) unsigned NOT NULL DEFAULT '1';

View File

@@ -122,7 +122,7 @@ void Corpse::SaveToDB()
stmt->setUInt32(index++, uint32(m_time)); // time
stmt->setUInt8 (index++, GetType()); // corpseType
stmt->setUInt32(index++, GetInstanceId()); // instanceId
stmt->setUInt16(index++, GetPhaseMask()); // phaseMask
stmt->setUInt32(index++, GetPhaseMask()); // phaseMask
trans->Append(stmt);
CharacterDatabase.CommitTransaction(trans);
@@ -186,7 +186,7 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
m_time = time_t(fields[12].GetUInt32());
uint32 instanceId = fields[14].GetUInt32();
uint32 phaseMask = fields[15].GetUInt16();
uint32 phaseMask = fields[15].GetUInt32();
// place
SetLocationInstanceId(instanceId);

View File

@@ -999,7 +999,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
stmt->setUInt32(index++, GetEntry());
stmt->setUInt16(index++, uint16(mapid));
stmt->setUInt8(index++, spawnMask);
stmt->setUInt16(index++, uint16(GetPhaseMask()));
stmt->setUInt32(index++, GetPhaseMask());
stmt->setUInt32(index++, displayId);
stmt->setInt32(index++, int32(GetCurrentEquipmentId()));
stmt->setFloat(index++, GetPositionX());

View File

@@ -249,7 +249,7 @@ struct CreatureData
CreatureData() : dbData(true) {}
uint32 id; // entry in creature_template
uint16 mapid;
uint16 phaseMask;
uint32 phaseMask;
uint32 displayid;
int8 equipmentId;
float posX;

View File

@@ -712,7 +712,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
stmt->setUInt32(index++, GetEntry());
stmt->setUInt16(index++, uint16(mapid));
stmt->setUInt8(index++, spawnMask);
stmt->setUInt16(index++, uint16(GetPhaseMask()));
stmt->setUInt32(index++, GetPhaseMask());
stmt->setFloat(index++, GetPositionX());
stmt->setFloat(index++, GetPositionY());
stmt->setFloat(index++, GetPositionZ());

View File

@@ -582,7 +582,7 @@ struct GameObjectData
explicit GameObjectData() : dbData(true) {}
uint32 id; // entry in gamobject_template
uint16 mapid;
uint16 phaseMask;
uint32 phaseMask;
float posX;
float posY;
float posZ;

View File

@@ -1561,7 +1561,7 @@ void ObjectMgr::LoadCreatures()
data.curmana = fields[13].GetUInt32();
data.movementType = fields[14].GetUInt8();
data.spawnMask = fields[15].GetUInt8();
data.phaseMask = fields[16].GetUInt16();
data.phaseMask = fields[16].GetUInt32();
int16 gameEvent = fields[17].GetInt8();
uint32 PoolId = fields[18].GetUInt32();
data.npcflag = fields[19].GetUInt32();
@@ -1913,7 +1913,7 @@ void ObjectMgr::LoadGameobjects()
if (data.spawnMask & ~spawnMasks[data.mapid])
TC_LOG_ERROR(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
data.phaseMask = fields[15].GetUInt16();
data.phaseMask = fields[15].GetUInt32();
int16 gameEvent = fields[16].GetInt8();
uint32 PoolId = fields[17].GetUInt32();

View File

@@ -279,8 +279,8 @@ public:
bool found = false;
float x, y, z, o;
uint32 guidLow, id;
uint16 mapId, phase;
uint32 guidLow, id, phase;
uint16 mapId;
uint32 poolId;
do
@@ -293,7 +293,7 @@ public:
z = fields[4].GetFloat();
o = fields[5].GetFloat();
mapId = fields[6].GetUInt16();
phase = fields[7].GetUInt16();
phase = fields[7].GetUInt32();
poolId = sPoolMgr->IsPartOfAPool<GameObject>(guidLow);
if (!poolId || sPoolMgr->IsSpawnedObject<GameObject>(guidLow))
found = true;

View File

@@ -216,7 +216,7 @@ public:
void SummonedCreatureDespawn(Creature* summon) OVERRIDE
{
uint32 phase= summon->GetPhaseMask();
uint32 phase = summon->GetPhaseMask();
uint32 nextPhase = 0;
Summons.Despawn(summon);