1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-19 12:02:24 +02:00

* 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
This commit is contained in:
Michał W. Urbańczyk 2009-02-04 03:55:12 +00:00
parent 680993459a
commit 886ab94708
4 changed files with 14 additions and 14 deletions

View File

@ -55,7 +55,7 @@ void AdventureMapButton::clickLeft (tribool down)
//if(!callback.empty()) //if(!callback.empty())
callback(); callback();
} }
else if (pressedL && (down==false)) else if (!actOnDown && pressedL && (down==false))
{ {
pressedL=state; pressedL=state;
//if(!callback.empty()) //if(!callback.empty())
@ -371,10 +371,6 @@ void CSlider::clickLeft (tribool down)
moveTo(rw*amount); moveTo(rw*amount);
return; return;
} }
else
{
moving = false;
}
if(moving) if(moving)
{ {
MotionInterested::deactivate(); MotionInterested::deactivate();

View File

@ -3520,8 +3520,12 @@ CLevelWindow::CLevelWindow(const CGHeroInstance *hero, int pskill, std::vector<u
cb = callback; cb = callback;
for(int i=0;i<skills.size();i++) for(int i=0;i<skills.size();i++)
comps.push_back(new CSelectableComponent(SComponent::secskill44,skills[i],hero->getSecSkillLevel(skills[i])+1,boost::bind(&CLevelWindow::selectionChanged,this,i))); comps.push_back(new CSelectableComponent(SComponent::secskill44,skills[i],hero->getSecSkillLevel(skills[i])+1,boost::bind(&CLevelWindow::selectionChanged,this,i)));
comps[0]->assignedKeys.insert(SDLK_1); if(comps.size())
comps[1]->assignedKeys.insert(SDLK_2); {
comps[0]->assignedKeys.insert(SDLK_1);
if(comps.size() > 1)
comps[1]->assignedKeys.insert(SDLK_2);
}
bitmap = BitmapHandler::loadBitmap("LVLUPBKG.bmp"); bitmap = BitmapHandler::loadBitmap("LVLUPBKG.bmp");
graphics->blueToPlayersAdv(bitmap,hero->tempOwner); graphics->blueToPlayersAdv(bitmap,hero->tempOwner);
SDL_SetColorKey(bitmap,SDL_SRCCOLORKEY,SDL_MapRGB(bitmap->format,0,255,255)); SDL_SetColorKey(bitmap,SDL_SRCCOLORKEY,SDL_MapRGB(bitmap->format,0,255,255));

View File

@ -47,7 +47,7 @@
18 31 18 31
19 38 19 38
21 17 21 17
22 31 22 18
24 34 24 34
25 41 25 41
30 7 30 7

View File

@ -2095,17 +2095,17 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army
//adding war machines //adding war machines
if(hero1) 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.push_back(new CStack(&VLC->creh->creatures[146], 1, hero1->tempOwner, stacks.size(), true, 255));
stacks[stacks.size()-1]->position = 52; 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.push_back(new CStack(&VLC->creh->creatures[148], 1, hero1->tempOwner, stacks.size(), true, 255));
stacks[stacks.size()-1]->position = 18; 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.push_back(new CStack(&VLC->creh->creatures[147], 1, hero1->tempOwner, stacks.size(), true, 255));
stacks[stacks.size()-1]->position = 154; stacks[stacks.size()-1]->position = 154;
@ -2113,17 +2113,17 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army
} }
if(hero2) 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.push_back(new CStack(&VLC->creh->creatures[146], 1, hero2->tempOwner, stacks.size(), false, 255));
stacks[stacks.size()-1]->position = 66; 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.push_back(new CStack(&VLC->creh->creatures[148], 1, hero2->tempOwner, stacks.size(), false, 255));
stacks[stacks.size()-1]->position = 32; 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.push_back(new CStack(&VLC->creh->creatures[147], 1, hero2->tempOwner, stacks.size(), false, 255));
stacks[stacks.size()-1]->position = 168; stacks[stacks.size()-1]->position = 168;