aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Corpse.cpp17
-rw-r--r--src/game/Creature.cpp4
-rw-r--r--src/game/GameObject.cpp4
-rw-r--r--src/shared/revision_nr.h2
4 files changed, 18 insertions, 9 deletions
diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp
index 6f4b0191bb4..553c44b3b36 100644
--- a/src/game/Corpse.cpp
+++ b/src/game/Corpse.cpp
@@ -106,12 +106,21 @@ void Corpse::SaveToDB()
std::ostringstream ss;
ss << "INSERT INTO corpse (guid,player,position_x,position_y,position_z,orientation,zone,map,data,time,corpse_type,instance,phaseMask) VALUES ("
- << GetGUIDLow() << ", " << GUID_LOPART(GetOwnerGUID()) << ", " << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", "
- << GetOrientation() << ", " << GetZoneId() << ", " << GetMapId() << ", '";
+ << GetGUIDLow() << ", "
+ << GUID_LOPART(GetOwnerGUID()) << ", "
+ << GetPositionX() << ", "
+ << GetPositionY() << ", "
+ << GetPositionZ() << ", "
+ << GetOrientation() << ", "
+ << GetZoneId() << ", "
+ << GetMapId() << ", '";
for(uint16 i = 0; i < m_valuesCount; i++ )
ss << GetUInt32Value(i) << " ";
- ss << "'," << uint64(m_time) <<", " << uint32(GetType())
- << ", " << int(GetInstanceId()) << ", " << int(GetPhaseMask()) << ")";
+ ss << "',"
+ << uint64(m_time) <<", "
+ << uint32(GetType()) << ", "
+ << int(GetInstanceId()) << ", "
+ << uint16(GetPhaseMask()) << ")"; // prevent out of range error
CharacterDatabase.Execute( ss.str().c_str() );
CharacterDatabase.CommitTransaction();
}
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index bc8105abcc1..52404842673 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1245,8 +1245,8 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
<< m_DBTableGuid << ","
<< GetEntry() << ","
<< mapid <<","
- << (uint32)spawnMask << ","
- << (uint32)GetPhaseMask() << ","
+ << uint32(spawnMask) << "," // cast to prevent save as symbol
+ << uint16(GetPhaseMask()) << "," // prevent out of range error
<< displayId <<","
<< GetEquipmentId() <<","
<< GetPositionX() << ","
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index 9f1c938ddd3..2e0ebfb613c 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -560,8 +560,8 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
<< m_DBTableGuid << ", "
<< GetEntry() << ", "
<< mapid << ", "
- << (uint32)spawnMask << ", "
- << (uint32)GetPhaseMask() << ","
+ << uint32(spawnMask) << "," // cast to prevent save as symbol
+ << uint16(GetPhaseMask()) << "," // prevent out of range error
<< GetFloatValue(GAMEOBJECT_POS_X) << ", "
<< GetFloatValue(GAMEOBJECT_POS_Y) << ", "
<< GetFloatValue(GAMEOBJECT_POS_Z) << ", "
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index 5399b44cb68..9ab590e6486 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "7346"
+ #define REVISION_NR "7347"
#endif // __REVISION_NR_H__