diff options
author | megamage <none@none> | 2008-12-12 11:21:28 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-12 11:21:28 -0600 |
commit | b6c288ca9fb271923f493ee39d78b5dc4b2a996f (patch) | |
tree | ec03c0dce11277c5e04f87a33ca76f1dd78687e7 /src/game/Object.h | |
parent | 135f39a5efabc12728924933056f3ea952dd2c09 (diff) |
*Update to Mangos 6902. Source: Mangos.
*Skipped rev: rev 6893, some code about waypoint movement.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.h')
-rw-r--r-- | src/game/Object.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/game/Object.h b/src/game/Object.h index a63458e6133..4eab67185df 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -234,6 +234,24 @@ class TRINITY_DLL_SPEC Object return (m_uint32Values[ index ] & flag) != 0; } + void SetByteFlag( uint16 index, uint8 offset, uint8 newFlag ); + void RemoveByteFlag( uint16 index, uint8 offset, uint8 newFlag ); + + void ToggleFlag( uint16 index, uint8 offset, uint8 flag ) + { + if(HasByteFlag(index, offset, flag)) + RemoveByteFlag(index, offset, flag); + else + SetByteFlag(index, offset, flag); + } + + bool HasByteFlag( uint16 index, uint8 offset, uint8 flag ) const + { + ASSERT( index < m_valuesCount || PrintIndexError( index , false ) ); + ASSERT( offset < 4 ); + return (((uint8*)&m_uint32Values[index])[offset] & flag) != 0; + } + void ApplyModFlag( uint16 index, uint32 flag, bool apply) { if(apply) SetFlag(index,flag); else RemoveFlag(index,flag); @@ -305,7 +323,7 @@ class TRINITY_DLL_SPEC Object { int32 *m_int32Values; uint32 *m_uint32Values; - float *m_floatValues; + float *m_floatValues; }; uint32 *m_uint32Values_mirror; @@ -401,7 +419,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object InstanceData* GetInstanceData(); const char* GetName() const { return m_name.c_str(); } - void SetName(std::string newname) { m_name=newname; } + void SetName(const std::string& newname) { m_name=newname; } virtual const char* GetNameForLocaleIdx(int32 /*locale_idx*/) const { return GetName(); } |