diff options
| author | joschiwald <joschiwald.trinity@gmail.com> | 2015-02-01 20:52:05 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald.trinity@gmail.com> | 2015-02-01 20:52:05 +0100 |
| commit | 053d5f24eecd5785b09283d33cac6c4a9754c93a (patch) | |
| tree | 91074df4453984a9970bd43d3fa8267dc7994c83 /src/server/game/Entities/Object | |
| parent | b6eb66e192145061cb0e5fd9739adb2561855360 (diff) | |
Core/Packets:
- added inspect packets
- updated opcode values
Diffstat (limited to 'src/server/game/Entities/Object')
| -rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 9 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Object.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index a36e3c34afd..5e419c2017f 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1193,6 +1193,15 @@ void Object::ApplyModInt32Value(uint16 index, int32 val, bool apply) SetInt32Value(index, cur); } +void Object::ApplyModUInt16Value(uint16 index, uint8 offset, int16 val, bool apply) +{ + int16 cur = GetUInt16Value(index, offset); + cur += (apply ? val : -val); + if (cur < 0) + cur = 0; + SetUInt16Value(index, offset, cur); +} + void Object::ApplyModSignedFloatValue(uint16 index, float val, bool apply) { float cur = GetFloatValue(index); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index a1d68c2b80b..88d8cee9b2f 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -133,7 +133,6 @@ class Object void SetFloatValue(uint16 index, float value); void SetByteValue(uint16 index, uint8 offset, uint8 value); void SetUInt16Value(uint16 index, uint8 offset, uint16 value); - void SetInt16Value(uint16 index, uint8 offset, int16 value) { SetUInt16Value(index, offset, (uint16)value); } void SetGuidValue(uint16 index, ObjectGuid const& value); void SetStatFloatValue(uint16 index, float value); void SetStatInt32Value(uint16 index, int32 value); @@ -143,7 +142,7 @@ class Object void ApplyModUInt32Value(uint16 index, int32 val, bool apply); void ApplyModInt32Value(uint16 index, int32 val, bool apply); - void ApplyModUInt64Value(uint16 index, int32 val, bool apply); + void ApplyModUInt16Value(uint16 index, uint8 offset, int16 val, bool apply); void ApplyModPositiveFloatValue(uint16 index, float val, bool apply); void ApplyModSignedFloatValue(uint16 index, float val, bool apply); void ApplyPercentModFloatValue(uint16 index, float val, bool apply); |
