aboutsummaryrefslogtreecommitdiff
path: root/src/game/Object.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-23 20:13:37 -0600
committermegamage <none@none>2009-03-23 20:13:37 -0600
commitf18a9c916d23c96c013f702aaec6b2c539ceb273 (patch)
tree9e1858c39f31538d2fa0c101d4b3911c811e822a /src/game/Object.cpp
parentdcb08352e7420b6a1277dfa5de359d2f19651cd9 (diff)
*Fix some crashes possibly related to vehicles.
*Fix a bug that client crashes when seer is far away from caster. --HG-- branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r--src/game/Object.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index b17f905b7dd..d84e2b7c07e 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -864,6 +864,48 @@ void Object::SetUInt64Value( uint16 index, const uint64 &value )
}
}
+bool Object::AddUInt64Value(uint16 index, const uint64 &value)
+{
+ ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , true ) );
+ if(value && !*((uint64*)&(m_uint32Values[index])))
+ {
+ m_uint32Values[ index ] = *((uint32*)&value);
+ m_uint32Values[ index + 1 ] = *(((uint32*)&value) + 1);
+
+ if(m_inWorld)
+ {
+ if(!m_objectUpdated)
+ {
+ ObjectAccessor::Instance().AddUpdateObject(this);
+ m_objectUpdated = true;
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+bool Object::RemoveUInt64Value(uint16 index, const uint64 &value)
+{
+ ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , true ) );
+ if(value && *((uint64*)&(m_uint32Values[index])) == value)
+ {
+ m_uint32Values[ index ] = 0;
+ m_uint32Values[ index + 1 ] = 0;
+
+ if(m_inWorld)
+ {
+ if(!m_objectUpdated)
+ {
+ ObjectAccessor::Instance().AddUpdateObject(this);
+ m_objectUpdated = true;
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
void Object::SetFloatValue( uint16 index, float value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index , true ) );