Skip to content

Commit

Permalink
Fix toggle lamps for JIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Kexanone committed Jan 30, 2022
1 parent c70d2cf commit 3144243
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions components/common/fnc_jipId.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "script_component.hpp"

params ["_entity", "_prefix"];

format ["%1:%2", _prefix, _entity call BIS_fnc_netId] // Return value
11 changes: 7 additions & 4 deletions components/common/fnc_switchLamp.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "script_component.hpp"

[_this, {
params ["_objects", "_switchOn"];
{[_x, _switchOn] call BIS_fnc_switchLamp} forEach _objects;
}] remoteExecCall ["call", 0, "ACL_switchLamp"];
params ["_objects", "_switchOn"];
private _mode = ["OFF", "ON"] select _switchOn;

{
private _jip = [_x, "ACL_switchLamp"] call ACL_fnc_jipId;
[_x, _mode] remoteExecCall ["switchLight", 0, _jip];
} forEach _objects;

0 comments on commit 3144243

Please sign in to comment.