Closed zzam closed 5 months ago
I verified that stratagus PR 626 (Check each trigger-condition in each cycle) causes the failure.
More details: campaigns/human/level10h_c.sms:
for i,unit in ipairs(GetUnits(4)) do
if GetUnitVariable(unit, "Ident") == "unit-peasant" then
TransformUnit(unit, "unit-attack-peasant")
end
end
In GameCycle=1 the units are still of type unit-peasant. In GameCycle=2 the units are of type unit-attack-peasant.
Before PR 626, in GameCycle=1 the first trigger was checked (IfRescuedNearUnit). In GameCycle=2 the second trigger (the problematic one, GetPlayerData ....) was executed. Switching the order of triggers would also have broken it.
Now all triggers are executed in each cycle and it fails now in GameCycle=1 running the second trigger.
Options to fix it:
AddTrigger(
function()
return GameCycle > 1 and (GetPlayerData(4, "UnitTypesCount", "unit-attack-peasant") +
GetPlayerData(GetThisPlayer(), "UnitTypesCount", "unit-attack-peasant")) <= 3 end,
function() return ActionDefeat() end)
Describe the bug DileriumL reported in Discord: When starting the human mission 10 in wargus then the mission is immediately lost.
To Reproduce Steps to reproduce the behavior:
Expected behavior The game starts and can be played
Screenshots and Logs
Desktop (please complete the following information):