-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: freight missions not failing on mission store (#472)
fixes #471
- Loading branch information
Showing
5 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Client Side/Framework/Functions/Freight/fn_onEachFrameFreight.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
** Author: Jack "Scarso" Farhall | ||
** Description: | ||
*/ | ||
#include "..\..\script_macros.hpp" | ||
scopeName "fn_onEachFrameFreight"; | ||
|
||
_this params [ "_location", "_pos" ]; | ||
|
||
private _vehicle = (missionNamespace getVariable ["ULP_FreightVehicle", [objNull, 0]]) param [0, objNull]; | ||
|
||
if (isNull _vehicle || { !(alive _vehicle) }) exitWith { | ||
private _freightMission = ULP_Missions getOrDefault ["CorporateFreight", []]; | ||
|
||
if !(_freightMission isEqualTo []) then { | ||
_freightMission params [ | ||
"_task", "_reward", "_eachFrame" | ||
]; | ||
|
||
_task setTaskState "Failed"; | ||
player removeSimpleTask _task; | ||
|
||
ULP_Missions deleteAt "CorporateFreight"; | ||
|
||
["Your vehicle was lost and your freight mission has failed."] call ULP_fnc_hint; | ||
}; | ||
|
||
[_thisEventHandler] call ULP_fnc_removeEachFrame; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters