diff options
author | Shauren <shauren.trinity@gmail.com> | 2016-06-28 18:34:50 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2016-06-28 18:34:50 +0200 |
commit | 1c10f9c311a79f7c9630b29e56a122cc9b118f3c (patch) | |
tree | 3f42cb1b0242b5000075532fc04c5aecf8a7b488 | |
parent | 40510c24ed672b0eb4153aac4717dd8e02fbecdd (diff) |
Core/PacketIO: Fixed building SMSG_UPDATE_OBJECT
-rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Entities/Object/Object.h | 4 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 0522ef13095..b1a915e474e 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1355,7 +1355,7 @@ std::vector<uint32> const& Object::GetDynamicValues(uint16 index) const return _dynamicValues[index]; } -uint32 Object::GetDynamicValue(uint16 index, uint8 offset) const +uint32 Object::GetDynamicValue(uint16 index, uint16 offset) const { ASSERT(index < _dynamicValuesCount || PrintIndexError(index, false)); ASSERT(offset < _dynamicValues[index].size()); @@ -1402,7 +1402,7 @@ void Object::ClearDynamicValue(uint16 index) } } -void Object::SetDynamicValue(uint16 index, uint8 offset, uint32 value) +void Object::SetDynamicValue(uint16 index, uint16 offset, uint32 value) { ASSERT(index < _dynamicValuesCount || PrintIndexError(index, false)); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index bd31af9363c..07e6acdfa0b 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -168,11 +168,11 @@ class TC_GAME_API Object void ApplyModFlag64(uint16 index, uint64 flag, bool apply); std::vector<uint32> const& GetDynamicValues(uint16 index) const; - uint32 GetDynamicValue(uint16 index, uint8 offset) const; + uint32 GetDynamicValue(uint16 index, uint16 offset) const; void AddDynamicValue(uint16 index, uint32 value); void RemoveDynamicValue(uint16 index, uint32 value); void ClearDynamicValue(uint16 index); - void SetDynamicValue(uint16 index, uint8 offset, uint32 value); + void SetDynamicValue(uint16 index, uint16 offset, uint32 value); void ClearUpdateMask(bool remove); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 551efbca752..e117a859da6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15732,10 +15732,10 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) fieldBuffer << uint32(m_floatValues[index] < 0 ? 0 : m_floatValues[index]); } // there are some float values which may be negative or can't get negative due to other checks - else if ((index >= UNIT_FIELD_NEGSTAT && index < UNIT_FIELD_NEGSTAT + 5) || - (index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + 6)) || - (index >= UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + 6)) || - (index >= UNIT_FIELD_POSSTAT && index < UNIT_FIELD_POSSTAT + 5)) + else if ((index >= UNIT_FIELD_NEGSTAT && index < UNIT_FIELD_NEGSTAT + MAX_STATS) || + (index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index < (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + MAX_SPELL_SCHOOL)) || + (index >= UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE && index < (UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + MAX_SPELL_SCHOOL)) || + (index >= UNIT_FIELD_POSSTAT && index < UNIT_FIELD_POSSTAT + MAX_STATS)) { fieldBuffer << uint32(m_floatValues[index]); } |