From 886ab94708fd19739d0b51a1033587ecefb7d175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Wed, 4 Feb 2009 03:55:12 +0000 Subject: [PATCH] * spell books tend won't be placed in War Machine slots. [Use ->getArt function to check if artifact is present, NOT ->artifWorn[slot]!!!] * Rampart's Treasury requires Miner's Guild * fixed hanging scrollbar and related crash * fixed crash when hero get level and has less than two sec. skills to choose between --- AdventureMapButton.cpp | 6 +----- CPlayerInterface.cpp | 8 ++++++-- config/requirements.txt | 2 +- server/CGameHandler.cpp | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/AdventureMapButton.cpp b/AdventureMapButton.cpp index 184dda8de..3d9721db8 100644 --- a/AdventureMapButton.cpp +++ b/AdventureMapButton.cpp @@ -55,7 +55,7 @@ void AdventureMapButton::clickLeft (tribool down) //if(!callback.empty()) callback(); } - else if (pressedL && (down==false)) + else if (!actOnDown && pressedL && (down==false)) { pressedL=state; //if(!callback.empty()) @@ -371,10 +371,6 @@ void CSlider::clickLeft (tribool down) moveTo(rw*amount); return; } - else - { - moving = false; - } if(moving) { MotionInterested::deactivate(); diff --git a/CPlayerInterface.cpp b/CPlayerInterface.cpp index e97bb9874..68855a812 100644 --- a/CPlayerInterface.cpp +++ b/CPlayerInterface.cpp @@ -3520,8 +3520,12 @@ CLevelWindow::CLevelWindow(const CGHeroInstance *hero, int pskill, std::vectorgetSecSkillLevel(skills[i])+1,boost::bind(&CLevelWindow::selectionChanged,this,i))); - comps[0]->assignedKeys.insert(SDLK_1); - comps[1]->assignedKeys.insert(SDLK_2); + if(comps.size()) + { + comps[0]->assignedKeys.insert(SDLK_1); + if(comps.size() > 1) + comps[1]->assignedKeys.insert(SDLK_2); + } bitmap = BitmapHandler::loadBitmap("LVLUPBKG.bmp"); graphics->blueToPlayersAdv(bitmap,hero->tempOwner); SDL_SetColorKey(bitmap,SDL_SRCCOLORKEY,SDL_MapRGB(bitmap->format,0,255,255)); diff --git a/config/requirements.txt b/config/requirements.txt index c75ff5e13..ab17d032f 100644 --- a/config/requirements.txt +++ b/config/requirements.txt @@ -47,7 +47,7 @@ 18 31 19 38 21 17 -22 31 +22 18 24 34 25 41 30 7 diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 5518114ab..edf3470ee 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2095,17 +2095,17 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army //adding war machines if(hero1) { - if(hero1->artifWorn[13]) //ballista + if(hero1->getArt(13)) //ballista { stacks.push_back(new CStack(&VLC->creh->creatures[146], 1, hero1->tempOwner, stacks.size(), true, 255)); stacks[stacks.size()-1]->position = 52; } - if(hero1->artifWorn[14]) //ammo cart + if(hero1->getArt(14)) //ammo cart { stacks.push_back(new CStack(&VLC->creh->creatures[148], 1, hero1->tempOwner, stacks.size(), true, 255)); stacks[stacks.size()-1]->position = 18; } - if(hero1->artifWorn[15]) //first aid tent + if(hero1->getArt(15)) //first aid tent { stacks.push_back(new CStack(&VLC->creh->creatures[147], 1, hero1->tempOwner, stacks.size(), true, 255)); stacks[stacks.size()-1]->position = 154; @@ -2113,17 +2113,17 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army } if(hero2) { - if(hero2->artifWorn[13]) //ballista + if(hero1->getArt(13)) //ballista { stacks.push_back(new CStack(&VLC->creh->creatures[146], 1, hero2->tempOwner, stacks.size(), false, 255)); stacks[stacks.size()-1]->position = 66; } - if(hero2->artifWorn[14]) //ammo cart + if(hero2->getArt(14)) //ammo cart { stacks.push_back(new CStack(&VLC->creh->creatures[148], 1, hero2->tempOwner, stacks.size(), false, 255)); stacks[stacks.size()-1]->position = 32; } - if(hero2->artifWorn[15]) //first aid tent + if(hero2->getArt(15)) //first aid tent { stacks.push_back(new CStack(&VLC->creh->creatures[147], 1, hero2->tempOwner, stacks.size(), false, 255)); stacks[stacks.size()-1]->position = 168;