From fb9d76f851e5bc7a05ad59be7e153c643c4cf784 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Mon, 1 Dec 2014 14:16:53 -0800 Subject: [PATCH] GetSpellBlockedMessage converted to xyz_location --- zone/spells.cpp | 4 ++-- zone/zone.cpp | 8 ++++---- zone/zone.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index 52bb094fa..da6e4f40c 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -522,7 +522,7 @@ bool Mob::DoCastingChecks() } if (zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) { - const char *msg = zone->GetSpellBlockedMessage(spell_id, GetX(), GetY(), GetZ()); + const char *msg = zone->GetSpellBlockedMessage(spell_id, GetPosition()); if (msg) { Message(13, msg); return false; @@ -1894,7 +1894,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(IsClient() && !CastToClient()->GetGM()){ if(zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())){ - const char *msg = zone->GetSpellBlockedMessage(spell_id, GetX(), GetY(), GetZ()); + const char *msg = zone->GetSpellBlockedMessage(spell_id, GetPosition()); if(msg){ Message(13, msg); return false; diff --git a/zone/zone.cpp b/zone/zone.cpp index b343c335b..b61cb3968 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1939,7 +1939,7 @@ bool Zone::IsSpellBlocked(uint32 spell_id, float nx, float ny, float nz) return false; } -const char* Zone::GetSpellBlockedMessage(uint32 spell_id, float nx, float ny, float nz) +const char* Zone::GetSpellBlockedMessage(uint32 spell_id, const xyz_location& location) { if(blocked_spells) { @@ -1957,9 +1957,9 @@ const char* Zone::GetSpellBlockedMessage(uint32 spell_id, float nx, float ny, fl } case 2: { - if((( nx > (blocked_spells[x].m_Location.m_X-blocked_spells[x].m_Difference.m_X)) && (nx < (blocked_spells[x].m_Location.m_X+blocked_spells[x].m_Difference.m_X))) && - (( ny > (blocked_spells[x].m_Location.m_Y-blocked_spells[x].m_Difference.m_Y)) && (ny < (blocked_spells[x].m_Location.m_Y+blocked_spells[x].m_Difference.m_Y))) && - (( nz > (blocked_spells[x].m_Location.m_Z-blocked_spells[x].m_Difference.m_Z)) && (nz < (blocked_spells[x].m_Location.m_Z+blocked_spells[x].m_Difference.m_Z)))) + if((( location.m_X > (blocked_spells[x].m_Location.m_X-blocked_spells[x].m_Difference.m_X)) && (location.m_X < (blocked_spells[x].m_Location.m_X+blocked_spells[x].m_Difference.m_X))) && + (( location.m_Y > (blocked_spells[x].m_Location.m_Y-blocked_spells[x].m_Difference.m_Y)) && (location.m_Y < (blocked_spells[x].m_Location.m_Y+blocked_spells[x].m_Difference.m_Y))) && + (( location.m_Z > (blocked_spells[x].m_Location.m_Z-blocked_spells[x].m_Difference.m_Z)) && (location.m_Z < (blocked_spells[x].m_Location.m_Z+blocked_spells[x].m_Difference.m_Z)))) { return blocked_spells[x].message; } diff --git a/zone/zone.h b/zone/zone.h index 0fa390512..48557ccad 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -246,7 +246,7 @@ public: void LoadBlockedSpells(uint32 zoneid); void ClearBlockedSpells(); bool IsSpellBlocked(uint32 spell_id, float nx, float ny, float nz); - const char *GetSpellBlockedMessage(uint32 spell_id, float nx, float ny, float nz); + const char *GetSpellBlockedMessage(uint32 spell_id, const xyz_location& location); int GetTotalBlockedSpells() { return totalBS; } inline bool HasMap() { return zonemap != nullptr; } inline bool HasWaterMap() { return watermap != nullptr; } @@ -324,7 +324,7 @@ private: Timer* Instance_Warning_timer; LinkedList client_auth_list; QGlobalCache *qGlobals; - + Timer hotzone_timer; };