mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Rework CCallback <-> CClient interaction
- callback is now part of lib instead of weird class that is shared by client and AI while being part of client - callback interacts with client class via minimal interface class - removed no longer used unlockGsWhileWaiting field
This commit is contained in:
@@ -707,8 +707,7 @@ void BattleWindow::bAutofightf()
|
||||
|
||||
ai->initBattleInterface(owner.curInt->env, owner.curInt->cb, autocombatPreferences);
|
||||
ai->battleStart(owner.getBattleID(), owner.army1, owner.army2, int3(0,0,0), owner.attackingHeroInstance, owner.defendingHeroInstance, owner.getBattle()->battleGetMySide(), false);
|
||||
owner.curInt->autofightingAI = ai;
|
||||
owner.curInt->cb->registerBattleInterface(ai);
|
||||
owner.curInt->registerBattleInterface(ai);
|
||||
|
||||
owner.requestAutofightingAIToTakeAction();
|
||||
}
|
||||
@@ -910,9 +909,7 @@ void BattleWindow::endWithAutocombat()
|
||||
ai->battleStart(owner.getBattleID(), owner.army1, owner.army2, int3(0,0,0), owner.attackingHeroInstance, owner.defendingHeroInstance, owner.getBattle()->battleGetMySide(), false);
|
||||
|
||||
owner.curInt->isAutoFightOn = true;
|
||||
owner.curInt->cb->registerBattleInterface(ai);
|
||||
owner.curInt->autofightingAI = ai;
|
||||
|
||||
owner.curInt->registerBattleInterface(ai);
|
||||
owner.requestAutofightingAIToTakeAction();
|
||||
|
||||
close();
|
||||
|
||||
Reference in New Issue
Block a user