瀏覽代碼

small fixes

mateuszb 17 年之前
父節點
當前提交
20a6e05718
共有 3 個文件被更改,包括 9 次插入5 次删除
  1. 1 0
      CBattleInterface.cpp
  2. 1 1
      CCursorHandler.cpp
  3. 7 4
      client/CSpellWindow.cpp

+ 1 - 0
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);

+ 1 - 1
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;

+ 7 - 4
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<CBattleInterface*>(LOCPLINT->curint)) //if battle window is open
+	if(!down && mySpell!=-1)
 	{
-		dynamic_cast<CBattleInterface*>(LOCPLINT->curint)->castThisSpell(mySpell);
+		//we will cast a spell
+		if(dynamic_cast<CBattleInterface*>(LOCPLINT->curint)) //if battle window is open
+		{
+			dynamic_cast<CBattleInterface*>(LOCPLINT->curint)->castThisSpell(mySpell);
+		}
+		owner->fexitb();
 	}
 }