(0007802)
|
mpech
|
2019-05-29 09:27
|
|
when looping (blue does not end its turn)
```
TRACE network [7f2c45d84700] - Applied on gs: 20BattleSetActiveStack
TRACE global [7f2c45d84700] - Making action: {BattleAction: side '0', stackNumber '0', actionType 'Shoot', actionSubtype '-1', target {3@{BattleHex: x '15', y '5', hex '100'},}}
TRACE global [7f2c45d84700] - CGameHandler::makeBattleAction, shoot type
TRACE global [7f2c45d84700] - CBattleInfoCallback::battleCanShoot 24
TRACE network [7f2c45d84700] - Sending to all clients: 13SystemMessage
TRACE network [7f2c45d84700] - Sending a pack of type 13SystemMessage
==>ERROR global [7f2c45d84700] - Cannot shoot!
TRACE global [7f2c45d84700] - CGameHandler::runBattle, getnextstack
TRACE global [7f2c45d84700] - CGameHandler::runBattle, aim
TRACE network [7f2c45d84700] - Sending to all clients: 20BattleSetActiveStack
TRACE network [7f2c45d84700] - Sending a pack of type 20BattleSetActiveStack
TRACE network [7f2c45d84700] - Applied on gs: 20BattleSetActiveStack
TRACE global [7f2c45d84700] - Making action: {BattleAction: side '0', stackNumber '0', actionType 'Shoot', actionSubtype '-1', target {3@{BattleHex: x '15', y '5', hex '100'},}}
```
when ok (that is round before 23)
```
TRACE global [7f2c45d84700] - Making action: {BattleAction: side '0', stackNumber '0', actionType 'Shoot', actionSubtype '-1', target {3@{BattleHex: x '15', y '5', hex '100'},}}
TRACE global [7f2c45d84700] - CGameHandler::makeBattleAction, shoot type
TRACE global [7f2c45d84700] - CBattleInfoCallback::battleCanShoot 23
TRACE network [7f2c45d84700] - Sending to all clients: 11StartAction
TRACE network [7f2c45d84700] - Sending a pack of type 11StartAction
TRACE network [7f2c45d84700] - Applied on gs: 11StartAction
TRACE network [7f2c45d84700] - Sending to all clients: 12BattleAttack
TRACE network [7f2c45d84700] - Sending a pack of type 12BattleAttack
TRACE network [7f2c45d84700] - Applied on gs: 12BattleAttack
TRACE network [7f2c45d84700] - Sending to all clients: 9EndAction
TRACE network [7f2c45d84700] - Sending a pack of type 9EndAction
```
I guess if canShoot, makeAttack triggers some stuff (in particular StartAction/EndAction) so getNextStack() rolls out to behe.
If !canShoot no action is taken and getNextStack does not move to next stack
by dumbly applying the wrapAction if case of !canShoot, round can end even if ballista does not shoot
```
case EActionType::SHOOT:
{
//...
auto destination = target.at(0).hexValue;
const CStack * destinationStack = gs->curB->battleGetStackByPos(destination);
if (!gs->curB->battleCanShoot(stack, destination))
{
logGlobal->trace("CGameHandler::makeBattleAction, cannot shoot bbrrrrr");
if(stack->creatureIndex() == CreatureID::BALLISTA){
logGlobal->trace("CGameHandler::makeBattleAction, isballista");
auto wrapper = wrapAction(ba);
}else{
complain("Cannot shoot!");
}
break;
}
```
```
TRACE global [7f1da53bc700] - CGameHandler::makeBattleAction, cannot shoot bbrrrrr
TRACE global [7f1da53bc700] - CGameHandler::makeBattleAction, isballista
TRACE network [7f1da53bc700] - Sending to all clients: 11StartAction
TRACE network [7f1da53bc700] - Sending a pack of type 11StartAction
TRACE network [7f1da53bc700] - Applied on gs: 11StartAction
TRACE network [7f1da53bc700] - Sending to all clients: 9EndAction
TRACE network [7f1da53bc700] - Sending a pack of type 9EndAction
TRACE network [7f1da53bc700] - Applied on gs: 9EndAction
TRACE global [7f1da53bc700] - CGameHandler::makeBattleAction, battlemadeactionistrue
TRACE global [7f1da53bc700] - CGameHandler::runBattle, getnextstack
TRACE global [7f1da53bc700] - Activating blue battle stack [2]: 100 of Behemoths from slot 0 of armyobj=1
```
I don't think this is a proper fix (because what about other complain from EActionType::SHOOT case?)
I am not sure either makeBattleAction purpose is to be only called from automatic ia (and not human)
|
|
(0007806)
|
mpech
|
2019-05-30 10:57
|
|
@polivetel i don't think so, 2453,2799 involves fortress, here we are in castle
2719 is seems to be a strategic "fail" (round can end but no action taken in round, here round does not end)
in added zzbalista2, attacking hero has now artillery.
We can see that _without_ fix, ballista with no ammunition chose to defend.
so bug only occurs if ballista has no ammunition AND hero has no artillery skill |
|