Core/Misc: Fix some static analysis issues
Fix uninitialized values, most of which are false positives, always initialized before being accessed. Add some asserts and additional NULL checks as sanity checks. Use SpellMgr::EnsureSpellInfo() if the spell id is valid and always supposed to return a valid not-NULL SpellInfo* .
This commit is contained in:
1 parent
30894c2bad
commit
8c44259fae
24 files changed
+66
-44
No files matched your search
@@ -413,6 +413,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
// 0x40
|
||||
if (flags & UPDATEFLAG_STATIONARY_POSITION)
|
||||
{
|
||||
ASSERT(object);
|
||||
*data << object->GetStationaryX();
|
||||
*data << object->GetStationaryY();
|
||||
*data << object->GetStationaryZ();
|
||||
@@ -486,6 +487,9 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
if (flags & UPDATEFLAG_VEHICLE)
|
||||
{
|
||||
/// @todo Allow players to aquire this updateflag.
|
||||
ASSERT(unit);
|
||||
ASSERT(unit->GetVehicleKit());
|
||||
ASSERT(unit->GetVehicleKit()->GetVehicleInfo());
|
||||
*data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->m_ID);
|
||||
if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
|
||||
*data << float(unit->GetTransOffsetO());
|
||||
|
||||
Reference in new issue
Block a user