aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellHandler.cpp
diff options
context:
space:
mode:
authorraczman <none@none>2010-03-07 15:20:19 +0100
committerraczman <none@none>2010-03-07 15:20:19 +0100
commit91b8ee104eac7446f9b8cbea7ed9dce641740c8e (patch)
tree2866b76745089d8066dad65b63e5aff07e92f4f6 /src/game/SpellHandler.cpp
parentaeebe57dc08d8b2d90972f50f00c4a28dd3947ba (diff)
Added new type-safe cast functions.
This, when properly used, should get rid of most memory corruption issues, currently, casting types C-style with no checks leads to some abstract crashing. Functionality is same as with dynamic_cast<>, but with no RTTI check - so when casting into invalid type you will receive NULL, and most probably crash. At the same time, i took the liberty to convert most Player* casts to ToPlayer(). Still needs crapload of casts being moved to new facility. --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellHandler.cpp')
-rw-r--r--src/game/SpellHandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
index 74e29ec0b3c..99de86f96d7 100644
--- a/src/game/SpellHandler.cpp
+++ b/src/game/SpellHandler.cpp
@@ -314,7 +314,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
if(mover->GetTypeId() == TYPEID_PLAYER)
{
// not have spell in spellbook or spell passive and not casted by client
- if (!((Player*)mover)->HasActiveSpell (spellId) || IsPassiveSpell(spellId) )
+ if (!mover->ToPlayer()->HasActiveSpell (spellId) || IsPassiveSpell(spellId) )
{
//cheater? kick? ban?
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet