FAForever / FAForever/NomadMissions

M1 - Secondary objective completion

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
3
Forks
3
PR merge metrics
No merged PRs in 30d

Description

When I wont the missin even unfinished secondary objectives were marked as completed
Cause of this: https://github.com/FAForever/NomadMissions/blob/master/NMCA_001/NMCA_001_script.lua#L183
It just markes all the objectives as completed

and this https://github.com/FAForever/NomadMissions/blob/master/NMCA_001/NMCA_001_script.lua#L227
which says that all are done with no condition testing if its actually true

Proper way of doing it is like this:
```LUA
function KillGame()
local secondary = Objectives.IsComplete(ScenarioInfo.M1S1) and
Objectives.IsComplete(ScenarioInfo.M2S1) and
Objectives.IsComplete(ScenarioInfo.M3S1) and
Objectives.IsComplete(ScenarioInfo.M4S1)
local bonus = Objectives.IsComplete(ScenarioInfo.M1B1) and
Objectives.IsComplete(ScenarioInfo.M1B2) and
Objectives.IsComplete(ScenarioInfo.M1B3) and
Objectives.IsComplete(ScenarioInfo.M2B1) and
Objectives.IsComplete(ScenarioInfo.M2B2) and
Objectives.IsComplete(ScenarioInfo.M4B1)
ScenarioFramework.EndOperation(ScenarioInfo.OpComplete, ScenarioInfo.OpComplete, secondary, bonus)
end
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.