1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

- fix for starting towns (#1180)

- fix for creature window (#1184)
This commit is contained in:
Ivan Savenko 2013-01-23 22:09:58 +00:00
parent d71b11de81
commit 080e037c54
2 changed files with 8 additions and 7 deletions

View File

@ -43,7 +43,7 @@ class CSelectableSkill;
*/ */
CCreatureWindow::CCreatureWindow (const CStack &stack, int Type): CCreatureWindow::CCreatureWindow (const CStack &stack, int Type):
CWindowObject(PLAYER_COLORED | (Type < 3 ? RCLICK_POPUP : 0 ) ), CWindowObject(PLAYER_COLORED | (Type == 0 ? RCLICK_POPUP : 0 ) ),
type(Type) type(Type)
{ {
OBJ_CONSTRUCTION_CAPTURING_ALL; OBJ_CONSTRUCTION_CAPTURING_ALL;
@ -58,7 +58,7 @@ CCreatureWindow::CCreatureWindow (const CStack &stack, int Type):
} }
CCreatureWindow::CCreatureWindow (const CStackInstance &stack, int Type): CCreatureWindow::CCreatureWindow (const CStackInstance &stack, int Type):
CWindowObject(PLAYER_COLORED | (Type < 3 ? RCLICK_POPUP : 0 ) ), CWindowObject(PLAYER_COLORED | (Type == 0 ? RCLICK_POPUP : 0 ) ),
type(Type) type(Type)
{ {
OBJ_CONSTRUCTION_CAPTURING_ALL; OBJ_CONSTRUCTION_CAPTURING_ALL;
@ -67,7 +67,7 @@ CCreatureWindow::CCreatureWindow (const CStackInstance &stack, int Type):
} }
CCreatureWindow::CCreatureWindow(int Cid, int Type, int creatureCount): CCreatureWindow::CCreatureWindow(int Cid, int Type, int creatureCount):
CWindowObject(PLAYER_COLORED | (Type < 3 ? RCLICK_POPUP : 0 ) ), CWindowObject(PLAYER_COLORED | (Type == 0 ? RCLICK_POPUP : 0 ) ),
type(Type) type(Type)
{ {
OBJ_CONSTRUCTION_CAPTURING_ALL; OBJ_CONSTRUCTION_CAPTURING_ALL;
@ -78,7 +78,7 @@ CCreatureWindow::CCreatureWindow(int Cid, int Type, int creatureCount):
} }
CCreatureWindow::CCreatureWindow(const CStackInstance &st, int Type, boost::function<void()> Upg, boost::function<void()> Dsm, UpgradeInfo *ui): CCreatureWindow::CCreatureWindow(const CStackInstance &st, int Type, boost::function<void()> Upg, boost::function<void()> Dsm, UpgradeInfo *ui):
CWindowObject(PLAYER_COLORED | (Type < 3 ? RCLICK_POPUP : 0 ) ), CWindowObject(PLAYER_COLORED | (Type == 0 ? RCLICK_POPUP : 0 ) ),
type(Type), type(Type),
dismiss(0), dismiss(0),
upgrade(0), upgrade(0),
@ -899,7 +899,7 @@ CIntObject * createCreWindow(
if(settings["general"]["classicCreatureWindow"].Bool()) if(settings["general"]["classicCreatureWindow"].Bool())
return new CCreInfoWindow(*s, lclick); return new CCreInfoWindow(*s, lclick);
else else
return new CCreatureWindow(*s, CCreatureWindow::BATTLE); return new CCreatureWindow(*s, lclick ? CCreatureWindow::BATTLE : CCreatureWindow::OTHER);
} }
} }

View File

@ -22,9 +22,10 @@ PlayerInfo::PlayerInfo(): canHumanPlay(false), canComputerPlay(false),
si8 PlayerInfo::defaultCastle() const si8 PlayerInfo::defaultCastle() const
{ {
if(allowedFactions.size() == 1) if(allowedFactions.size() == 1 || !isFactionRandom)
{ {
// only one faction is available - pick it // faction can't be chosen - set to first that is marked as allowed
assert(!allowedFactions.empty());
return *allowedFactions.begin(); return *allowedFactions.begin();
} }