Open E-Ledere opened 3 years ago
I no longer see this error if OPCOM is allowed to fully start up before executing the script.
sleep 10;
waituntil {
(OPCOM_INSTANCES select { !([_x,"startupComplete", false] call ALiVE_fnc_hashGet) }) isequalto []
};
{
if(([_x, "side", ""] call ALiVE_fnc_HashGet) == "WEST") then {
_objectives = [_x, "objectives", []] call ALiVE_fnc_HashGet;
private _id = [(_objectives # 0), "objectiveID", "empty"] call ALiVE_fnc_hashGet;
[_x, "removeObjective", _id] call ALiVE_fnc_OPCOM;
hint "Removing objective.";
};
} foreach OPCOM_INSTANCES;
You can check with a manual call to sortObjectives
{
if(([_x, "side", ""] call ALiVE_fnc_HashGet) == "WEST") then {
[_x, "sortObjectives"] call ALiVE_fnc_OPCOM;
};
} foreach OPCOM_INSTANCES;
Can you confirm this fixes your issue?
I'm continuing to see the same problem in the same test mission, it's just not reproducible 100% of the time anymore.
It still seems fairly reproducible with this code in initServer.sqf:
sleep 10;
waituntil {
(OPCOM_INSTANCES select { !([_x,"startupComplete", false] call ALiVE_fnc_hashGet) }) isequalto []
};
{
if(([_x, "side", ""] call ALiVE_fnc_HashGet) == "WEST") then {
_objectives = [_x, "objectives", []] call ALiVE_fnc_HashGet;
private _id = [(_objectives # 0), "objectiveID", "empty"] call ALiVE_fnc_hashGet;
[_x, "removeObjective", _id] call ALiVE_fnc_OPCOM;
hint "Removing objective.";
};
} foreach OPCOM_INSTANCES;
Seems like maybe a race condition that stems from a spawned code block which makes this tougher to track down. Will look again tomorrow.
Prerequisites
Description
Removing an objective using the "removeObjective" case in OPCOM can cause a script error to occur after the command successfully executes, specifically in the "sortObjective" case.
I have attached a test mission to this issue in which I was able to reliably replicate this problem.
Steps to Reproduce
Expected behavior: No script error.
Actual behavior: Script error.
aliveError.Stratis.zip Arma3_x64_2021-03-24_14-16-01.rpt.txt