mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-21 12:06:49 +02:00
- game won't crash on missing dwellings (instead random one will generated)
- added disabled code that can be used to fix buildings blit order - minor fixes
This commit is contained in:
parent
b3f317c1ed
commit
db10f512d5
@ -1141,6 +1141,35 @@ void CCastleInterface::keyPressed( const SDL_KeyboardEvent & key )
|
|||||||
|
|
||||||
switch(key.keysym.sym)
|
switch(key.keysym.sym)
|
||||||
{
|
{
|
||||||
|
#if 0 // code that can be used to fix blit order in towns using +/- keys. Quite ugly but works
|
||||||
|
case SDLK_KP_PLUS :
|
||||||
|
if (builds->selectedBuilding)
|
||||||
|
{
|
||||||
|
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
||||||
|
CStructure * str = const_cast<CStructure *>(builds->selectedBuilding->str);
|
||||||
|
str->pos.z++;
|
||||||
|
delete builds;
|
||||||
|
builds = new CCastleBuildings(town);
|
||||||
|
|
||||||
|
BOOST_FOREACH(const CStructure * str, town->town->clientInfo.structures)
|
||||||
|
tlog1 << int(str->building->bid) << " -> " << int(str->pos.z) << "\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SDLK_KP_MINUS:
|
||||||
|
if (builds->selectedBuilding)
|
||||||
|
{
|
||||||
|
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
||||||
|
CStructure * str = const_cast<CStructure *>(builds->selectedBuilding->str);
|
||||||
|
str->pos.z--;
|
||||||
|
delete builds;
|
||||||
|
builds = new CCastleBuildings(town);
|
||||||
|
|
||||||
|
BOOST_FOREACH(const CStructure * str, town->town->clientInfo.structures)
|
||||||
|
tlog1 << int(str->building->bid) << " -> " << int(str->pos.z) << "\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case SDLK_UP:
|
case SDLK_UP:
|
||||||
townlist->selectPrev();
|
townlist->selectPrev();
|
||||||
break;
|
break;
|
||||||
|
@ -1386,6 +1386,7 @@ void CRecruitmentWindow::select(CCreatureCard *card)
|
|||||||
totalCostValue->createItems(card->creature->cost);
|
totalCostValue->createItems(card->creature->cost);
|
||||||
|
|
||||||
costPerTroopValue->set(card->creature->cost);
|
costPerTroopValue->set(card->creature->cost);
|
||||||
|
totalCostValue->set(card->creature->cost * maxAmount);
|
||||||
|
|
||||||
//Recruit %s
|
//Recruit %s
|
||||||
title->setTxt(boost::str(boost::format(CGI->generaltexth->tcommands[21]) % card->creature->namePl));
|
title->setTxt(boost::str(boost::format(CGI->generaltexth->tcommands[21]) % card->creature->namePl));
|
||||||
|
@ -636,7 +636,12 @@ std::pair<int,int> CGameState::pickObject (CGObjectInstance *obj)
|
|||||||
result = std::pair<int,int>(17, iter.first);
|
result = std::pair<int,int>(17, iter.first);
|
||||||
|
|
||||||
if (result.first == -1)
|
if (result.first == -1)
|
||||||
|
{
|
||||||
tlog0 << "Error: failed to find creature for dwelling of "<< int(faction) << " of level " << int(level) << "\n";
|
tlog0 << "Error: failed to find creature for dwelling of "<< int(faction) << " of level " << int(level) << "\n";
|
||||||
|
auto iter = VLC->objh->cregens.begin();
|
||||||
|
std::advance(iter, ran() % VLC->objh->cregens.size() );
|
||||||
|
result = std::pair<int, int>(17, iter->first);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -2506,7 +2506,7 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid, bool force /*=false*/ )
|
|||||||
FoWChange fw;
|
FoWChange fw;
|
||||||
fw.player = t->tempOwner;
|
fw.player = t->tempOwner;
|
||||||
fw.mode = 1;
|
fw.mode = 1;
|
||||||
getTilesInRange(fw.tiles,t->pos,t->getSightRadious(),t->tempOwner,1);
|
t->getSightTiles(fw.tiles);
|
||||||
sendAndApply(&fw);
|
sendAndApply(&fw);
|
||||||
|
|
||||||
if (!force)
|
if (!force)
|
||||||
@ -3815,9 +3815,9 @@ void CGameHandler::playerMessage( ui8 player, const std::string &message )
|
|||||||
SetResources sr;
|
SetResources sr;
|
||||||
sr.player = player;
|
sr.player = player;
|
||||||
sr.res = gs->getPlayer(player)->resources;
|
sr.res = gs->getPlayer(player)->resources;
|
||||||
for(int i=0;i<7;i++)
|
for(int i=0;i<Res::GOLD;i++)
|
||||||
sr.res[i] += 100;
|
sr.res[i] += 100;
|
||||||
sr.res[6] += 19900;
|
sr.res[Res::GOLD] += 100000; //100k
|
||||||
sendAndApply(&sr);
|
sendAndApply(&sr);
|
||||||
}
|
}
|
||||||
else if(message == "vcmieagles") //reveal FoW
|
else if(message == "vcmieagles") //reveal FoW
|
||||||
|
Loading…
x
Reference in New Issue
Block a user