#Infinite Loop Mission Success End Issue

1 messages · Page 1 of 1 (latest)

viral crystal
#

I've been trying to figure out why I'm getting an infinite loop that keeps repeating a Mission Success End and how to fix it. Here is the part of the script that I believe is the issue:

// Check if Time Limit
if (_timeLimit) then {
    while { _time > 0 } do {
        _time = _time - 1;
        uiSleep 1;

        // Check if type CBRN
        if (_cbrn) then {
            // Check if captive
            // if ({ !captive _x } count _hostages >= _limitSuccess) exitWith {};
            
            if (_time <= 0) exitWith {
                private _itemCBRN = "SmokeShellYellow" createVehicle getMarkerPos _cbrnZone;

                uiSleep 5;

                {
                    if (captive _x) then {
                        _x setDamage 0.9;
                        _x playMove "acts_executionvictim_kill_end";

                        uiSleep 2.75;

                        _x setDamage 1;
                    };
                } forEach _hostages;
            };
        };
    };
};

// Check the success limit
if ({ _x inArea _extZone } count _hostages >= _limitSuccess) exitWith {
    [_taskID, "SUCCEEDED"] call BFUNC(taskSetState);

    // End the mission if it was enabled
    if (_endSuccess) then {
        [QEGVAR(end_mission,callMission), ["MissionSuccess", true, playerSide]] call CFUNC(serverEvent);
    };
};
#

Infinite Loop Mission Success End Issue