
This commit corrects a typo in the cargo damage handler within `fnc_makeCargo.sqf`. The event handler name was misspelled as "Dammaged" instead of "Damaged". This has been corrected to ensure the event handler functions as intended. Additionally, the hint message displayed when cargo is severely damaged also had the same typo, which has been corrected.
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: IDSolutions
|
|
* Assigns cargo to a task for delivery
|
|
*
|
|
* Arguments:
|
|
* 0: Object to convert to delivery cargo <OBJECT>
|
|
* 1: Task ID to assign the cargo to <STRING>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [_cargoObject, "delivery_1"] call forge_client_task_fnc_makeCargo;
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params [["_cargo", objNull, [objNull]], ["_taskID", "", [""]]];
|
|
|
|
diag_log format ["[FORGE] Make Cargo: %1", _this];
|
|
|
|
if (isNull _cargo) exitWith { diag_log "ERROR: Attempt to create cargo from null object"; };
|
|
if (_taskID == "") exitWith { diag_log "ERROR: No task ID provided for cargo"; };
|
|
|
|
SETPVAR(_cargo,assignedTask,_taskID);
|
|
GVAR(allCargo) pushBack _cargo;
|
|
|
|
_cargo addEventHandler ["Dammaged", {
|
|
params ["_unit", "_hitSelection", "_damage", "_hitPartIndex", "_hitPoint", "_shooter", "_projectile"];
|
|
|
|
if (damage _unit >= 0.7) then {
|
|
private _taskID = GETVAR(_unit,assignedTask,"");
|
|
if (_taskID isNotEqualTo "") then {
|
|
hint format ["Warning: Cargo severely dammaged! Task: %1", _taskID];
|
|
};
|
|
};
|
|
}]; |