From 20a6e0571848a483899b9796edc2c3dd8869541b Mon Sep 17 00:00:00 2001 From: mateuszb Date: Fri, 17 Oct 2008 17:43:25 +0000 Subject: [PATCH] small fixes --- CBattleInterface.cpp | 1 + CCursorHandler.cpp | 2 +- client/CSpellWindow.cpp | 11 +++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CBattleInterface.cpp b/CBattleInterface.cpp index d09b63c5e..c35246404 100644 --- a/CBattleInterface.cpp +++ b/CBattleInterface.cpp @@ -1049,6 +1049,7 @@ void CBattleInterface::hexLclicked(int whichOne) { spellToCast->destinationTile = whichOne; LOCPLINT->cb->battleMakeAction(spellToCast); + delete spellToCast; spellToCast = NULL; spellDestSelectMode = false; CGI->curh->changeGraphic(1, 6); diff --git a/CCursorHandler.cpp b/CCursorHandler.cpp index 2267da424..1581d39c5 100644 --- a/CCursorHandler.cpp +++ b/CCursorHandler.cpp @@ -33,7 +33,7 @@ void CCursorHandler::draw1() { if(!Show) return; int x = xpos, y = ypos; - if(mode==1 && number!=6) + if((mode==1 && number!=6) || mode ==3) { x-=16; y-=16; diff --git a/client/CSpellWindow.cpp b/client/CSpellWindow.cpp index 721bb6338..7583d9ac8 100644 --- a/client/CSpellWindow.cpp +++ b/client/CSpellWindow.cpp @@ -616,11 +616,14 @@ CSpellWindow::SpellArea::SpellArea(SDL_Rect pos, CSpellWindow * owner) void CSpellWindow::SpellArea::clickLeft(boost::logic::tribool down) { - owner->fexitb(); - //we will cast a spell - if(dynamic_cast(LOCPLINT->curint)) //if battle window is open + if(!down && mySpell!=-1) { - dynamic_cast(LOCPLINT->curint)->castThisSpell(mySpell); + //we will cast a spell + if(dynamic_cast(LOCPLINT->curint)) //if battle window is open + { + dynamic_cast(LOCPLINT->curint)->castThisSpell(mySpell); + } + owner->fexitb(); } }