mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Merge branch 'develop' into cheats
This commit is contained in:
@@ -781,7 +781,7 @@ void AIGateway::showGarrisonDialog(const CArmedInstance * up, const CGHeroInstan
|
||||
//you can't request action from action-response thread
|
||||
executeActionAsync("showGarrisonDialog", [this, up, down, removableUnits, queryID]()
|
||||
{
|
||||
if(removableUnits && up->tempOwner == down->tempOwner && nullkiller->settings->isGarrisonTroopsUsageAllowed() && !cb->getStartInfo()->isRestorationOfErathiaCampaign())
|
||||
if(removableUnits && up->tempOwner == down->tempOwner && nullkiller->settings->isGarrisonTroopsUsageAllowed() && !cb->getStartInfo()->restrictedGarrisonsForAI())
|
||||
{
|
||||
pickBestCreatures(down, up);
|
||||
}
|
||||
|
||||
@@ -453,19 +453,6 @@ void VCAI::objectRemoved(const CGObjectInstance * obj, const PlayerColor & initi
|
||||
//clear resource manager goal cache
|
||||
ah->removeOutdatedObjectives(checkRemovalValidity);
|
||||
|
||||
//TODO: Find better way to handle hero boat removal
|
||||
if(auto hero = dynamic_cast<const CGHeroInstance *>(obj))
|
||||
{
|
||||
if(hero->inBoat())
|
||||
{
|
||||
vstd::erase_if_present(visitableObjs, hero->getBoat());
|
||||
vstd::erase_if_present(alreadyVisited, hero->getBoat());
|
||||
|
||||
for(auto h : cb->getHeroesInfo())
|
||||
unreserveObject(h, hero->getBoat());
|
||||
}
|
||||
}
|
||||
|
||||
//TODO
|
||||
//there are other places where CGObjectinstance ptrs are stored...
|
||||
//
|
||||
@@ -762,7 +749,7 @@ void VCAI::showGarrisonDialog(const CArmedInstance * up, const CGHeroInstance *
|
||||
//you can't request action from action-response thread
|
||||
executeActionAsync("showGarrisonDialog", [this, down, up, removableUnits, queryID]()
|
||||
{
|
||||
if(removableUnits && !cb->getStartInfo()->isRestorationOfErathiaCampaign())
|
||||
if(removableUnits && !cb->getStartInfo()->restrictedGarrisonsForAI())
|
||||
pickBestCreatures(down, up);
|
||||
|
||||
answerQuery(queryID, 0);
|
||||
|
||||
Reference in New Issue
Block a user