mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Remove hardcoded check for number of heroes on map
This commit is contained in:
parent
d09fb07362
commit
66d96e6ef6
@ -2696,10 +2696,11 @@ bool CGameHandler::garrisonSwap(ObjectInstanceID tid)
|
||||
}
|
||||
else if (town->garrisonHero && !town->visitingHero) //move hero out of the garrison
|
||||
{
|
||||
//check if moving hero out of town will break 8 wandering heroes limit
|
||||
if (getHeroCount(town->garrisonHero->tempOwner,false) >= 8)
|
||||
int mapCap = VLC->settings()->getInteger(EGameSettings::HEROES_PER_PLAYER_ON_MAP_CAP);
|
||||
//check if moving hero out of town will break wandering heroes limit
|
||||
if (getHeroCount(town->garrisonHero->tempOwner,false) >= mapCap)
|
||||
{
|
||||
complain("Cannot move hero out of the garrison, there are already 8 wandering heroes!");
|
||||
complain("Cannot move hero out of the garrison, there are already " + std::to_string(mapCap) + " wandering heroes!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user