I should have saved the game where it was occurring, unfortunately I can't reproduce the issue anymore.
But basically I have code that looks like this:
Code: Select all
if <CONDITIONS>
local empire = current_side()
local attack = all_attacks[get_attack_id()]
for other_empire in pairs(attack.sides)
if Battle.enemy(empire,other_empire) and not Battle.get_cease_fire_offer(empire,other_empire)
console("offering a cease fire to ",other_empire,empire)
action.offer_cease_fire(empire,other_empire)
end
-- ...
end
else
--cancel any cease fire offers
local empire = current_side()
local attack = all_attacks[get_attack_id()]
for other_empire in pairs(attack.sides)
if Battle.get_cease_fire_offer(empire,other_empire)
console("rescinding cease fire to ",other_empire,empire)
Battle.set_cease_fire_offer(empire,other_empire,false)
end
end
end
And in the console I could see the message that the offer was rescinded, but the battle ended in a draw anyways.
I'll have to post back here when/if I can reproduce it.