aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-24 09:33:56 +0800
committermegamage <none@none>2009-07-24 09:33:56 +0800
commit68134b847cfa6ec46709c9895a422d35b3b7166f (patch)
treeba9664103047c808aa019733a310c1e083540bdf /src/game/GameObject.h
parentd80754a48004b0d20ada012a1638e8263a4f18ed (diff)
[8205] Really use trap GO charges and avoid casting in despawned state. Author: VladimirMangos
* Drop horribale hack with stored charges amount, use instead GO info charges data as expected. * Count trap activations as charge uses if it have limited charges. * Check trap reactions only in ready spawned state. --HG-- branch : trunk
Diffstat (limited to 'src/game/GameObject.h')
-rw-r--r--src/game/GameObject.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/game/GameObject.h b/src/game/GameObject.h
index 763117de167..97c532605d3 100644
--- a/src/game/GameObject.h
+++ b/src/game/GameObject.h
@@ -444,6 +444,17 @@ struct GameObjectInfo
}
}
+ uint32 GetCharges() const // despawn at uses amount
+ {
+ switch(type)
+ {
+ //case GAMEOBJECT_TYPE_TRAP: return trap.charges;
+ case GAMEOBJECT_TYPE_GUARDPOST: return guardpost.charges;
+ case GAMEOBJECT_TYPE_SPELLCASTER: return spellcaster.charges;
+ default: return 0;
+ }
+ }
+
uint32 GetLinkedGameObjectEntry() const
{
switch(type)
@@ -692,7 +703,6 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
uint64 GetRotation() const { return m_rotation; }
protected:
- uint32 m_charges; // Spell charges for GAMEOBJECT_TYPE_SPELLCASTER (22)
uint32 m_spellId;
time_t m_respawnTime; // (secs) time of next respawn (or despawn if GO have owner()),
uint32 m_respawnDelayTime; // (secs) if 0 then current GO state no dependent from timer