From f80c315307583b3450d19c8c88a784efb94bbf2f Mon Sep 17 00:00:00 2001 From: "False.Genesis" Date: Thu, 8 Mar 2007 19:47:24 +0000 Subject: [PATCH] * workaround for ticket #4 * forgot to set permission for exit.def --- bin/scripts/exit.def | 1 + src/Client/World/CMSGConstructor.cpp | 10 ++++++++-- src/Client/World/WorldSession.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/scripts/exit.def b/bin/scripts/exit.def index 615b97b..71be10a 100644 --- a/bin/scripts/exit.def +++ b/bin/scripts/exit.def @@ -1,3 +1,4 @@ +#permission=255 // just a name alternative QUIT \ No newline at end of file diff --git a/src/Client/World/CMSGConstructor.cpp b/src/Client/World/CMSGConstructor.cpp index fb2827f..a68c6b3 100644 --- a/src/Client/World/CMSGConstructor.cpp +++ b/src/Client/World/CMSGConstructor.cpp @@ -91,12 +91,18 @@ void WorldSession::SendSetSelection(uint64 guid) SendWorldPacket(packet); } -void WorldSession::SendCastSpell(uint32 spellid) +void WorldSession::SendCastSpell(uint32 spellid, bool nocheck) { if(!spellid) return; MyCharacter *my = GetMyChar(); - bool known = my->HasSpell(spellid); + bool known = nocheck ? true : my->HasSpell(spellid); + + //-- TEMP FIX --// TODO: need a list of spells that is excluded from the check and can always be casted. + // settable via DefScript? + if(spellid==836) + known=true; + if( (!known) && (!GetInstance()->GetConf()->disablespellcheck) ) { logerror("Attempt to cast not-known spell %u",spellid); diff --git a/src/Client/World/WorldSession.h b/src/Client/World/WorldSession.h index 0f689e1..8ebeb96 100644 --- a/src/Client/World/WorldSession.h +++ b/src/Client/World/WorldSession.h @@ -60,7 +60,7 @@ public: void SendEmote(uint32); void SendQueryItem(uint32, uint64); void SendSetSelection(uint64); - void SendCastSpell(uint32); + void SendCastSpell(uint32 spellid, bool nocheck=false); PlayerNameCache plrNameCache; ObjMgr objmgr;