aboutsummaryrefslogtreecommitdiff
path: root/src/game/Corpse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Corpse.cpp')
-rw-r--r--src/game/Corpse.cpp17
1 files changed, 13 insertions, 4 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();
}