mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #3542 from acemod/refuelGlobalEvents
Replace execRemoteFnc with events and increase fuel update delay in refuel
This commit is contained in:
commit
f956675d35
@ -152,6 +152,8 @@ if (isServer) then {
|
|||||||
["playMove", {(_this select 0) playMove (_this select 1)}] call FUNC(addEventHandler);
|
["playMove", {(_this select 0) playMove (_this select 1)}] call FUNC(addEventHandler);
|
||||||
["playMoveNow", {(_this select 0) playMoveNow (_this select 1)}] call FUNC(addEventHandler);
|
["playMoveNow", {(_this select 0) playMoveNow (_this select 1)}] call FUNC(addEventHandler);
|
||||||
["switchMove", {(_this select 0) switchMove (_this select 1)}] call FUNC(addEventHandler);
|
["switchMove", {(_this select 0) switchMove (_this select 1)}] call FUNC(addEventHandler);
|
||||||
|
["setVectorDirAndUp", {(_this select 0) setVectorDirAndUp (_this select 1)}] call FUNC(addEventHandler);
|
||||||
|
["setVanillaHitPointDamage", {(_this select 0) setHitPointDamage (_this select 1)}] call FUNC(addEventHandler);
|
||||||
|
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
|
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
|
||||||
|
@ -5,3 +5,7 @@
|
|||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}];
|
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[QGVAR(resetLocal), {
|
||||||
|
_this call FUNC(resetLocal);
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -27,9 +27,9 @@ private _fuel = [_target] call FUNC(getFuel);
|
|||||||
params ["_args"];
|
params ["_args"];
|
||||||
_args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_fuel", 0, [0]]];
|
_args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_fuel", 0, [0]]];
|
||||||
if (_fuel > 0 ) then {
|
if (_fuel > 0 ) then {
|
||||||
["displayTextStructured", [_unit], [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit]] call EFUNC(common,targetEvent);
|
["displayTextStructured", _unit, [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit]] call EFUNC(common,objectEvent);
|
||||||
} else {
|
} else {
|
||||||
["displayTextStructured", [_unit], [LSTRING(Hint_Empty), 2, _unit]] call EFUNC(common,targetEvent);
|
["displayTextStructured", _unit, [LSTRING(Hint_Empty), 2, _unit]] call EFUNC(common,objectEvent);
|
||||||
};
|
};
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
|
@ -119,7 +119,7 @@ _endPosTestOffset set [2, (_startingOffset select 2)];
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
[[_nozzle, _dirAndUp], "{(_this select 0) setVectorDirAndUp (_this select 1)}", 2] call EFUNC(common,execRemoteFnc);
|
["setVectorDirAndUp", _nozzle, [_nozzle, _dirAndUp]] call EFUNC(common,objectEvent);
|
||||||
_nozzle setVariable [QGVAR(sink), _target, true];
|
_nozzle setVariable [QGVAR(sink), _target, true];
|
||||||
_nozzle setVariable [QGVAR(isConnected), true, true];
|
_nozzle setVariable [QGVAR(isConnected), true, true];
|
||||||
_target setVariable [QGVAR(nozzle), _nozzle, true];
|
_target setVariable [QGVAR(nozzle), _nozzle, true];
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define PFH_STEPSIZE 0.1
|
#define PFH_STEPSIZE 1
|
||||||
|
|
||||||
params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_connectToPoint", [0,0,0], [[]], 3]];
|
params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_connectToPoint", [0,0,0], [[]], 3]];
|
||||||
|
|
||||||
@ -76,11 +76,7 @@ private _maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >>
|
|||||||
};
|
};
|
||||||
_unit setVariable [QGVAR(tempFuel), _fuelInSink];
|
_unit setVariable [QGVAR(tempFuel), _fuelInSink];
|
||||||
|
|
||||||
if !(local _sink) then {
|
["setFuel", _sink, [_sink, _fuelInSink]] call EFUNC(common,objectEvent);
|
||||||
[[_sink, _fuelInSink], "{(_this select 0) setFuel (_this select 1)}", _sink] call EFUNC(common,execRemoteFnc);
|
|
||||||
} else {
|
|
||||||
_sink setFuel _fuelInSink;
|
|
||||||
};
|
|
||||||
[_source, _fuelInSource] call FUNC(setFuel);
|
[_source, _fuelInSource] call FUNC(setFuel);
|
||||||
} else {
|
} else {
|
||||||
_unit setVariable [QGVAR(tempFuel), fuel _sink];
|
_unit setVariable [QGVAR(tempFuel), fuel _sink];
|
||||||
|
@ -17,11 +17,8 @@
|
|||||||
|
|
||||||
params [["_target", objNull, [objNull]]];
|
params [["_target", objNull, [objNull]]];
|
||||||
|
|
||||||
if (local _target) then {
|
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]] ] ] call EFUNC(common,objectEvent);
|
||||||
_target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]];
|
|
||||||
} else {
|
|
||||||
[[_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]], "{(_this select 0) setHitPointDamage (_this select 1)}", _target] call EFUNC(common,execRemoteFnc);
|
|
||||||
};
|
|
||||||
_target setVariable [QGVAR(engineHit), nil, true];
|
_target setVariable [QGVAR(engineHit), nil, true];
|
||||||
_target setVariable [QGVAR(isConnected), false, true];
|
_target setVariable [QGVAR(isConnected), false, true];
|
||||||
|
|
||||||
@ -38,11 +35,7 @@ if !(isNil "_nozzle") then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
if (local _x) then {
|
[QGVAR(resetLocal), _x, [_x, _nozzle]] call EFUNC(common,objectEvent);
|
||||||
[_x, _nozzle] call FUNC(resetLocal);
|
|
||||||
} else {
|
|
||||||
[[_x, _nozzle], "{_this call FUNC(resetLocal)}", _x] call EFUNC(common,execRemoteFnc);
|
|
||||||
};
|
|
||||||
} count allPlayers;
|
} count allPlayers;
|
||||||
deleteVehicle _nozzle;
|
deleteVehicle _nozzle;
|
||||||
};
|
};
|
||||||
|
@ -48,11 +48,7 @@ if (isNull _nozzle || {_source != _target}) exitWith {false};
|
|||||||
};
|
};
|
||||||
deleteVehicle _nozzle;
|
deleteVehicle _nozzle;
|
||||||
|
|
||||||
if !(local _target) then {
|
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]] ] ] call EFUNC(common,objectEvent);
|
||||||
[[_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]], "{(_this select 0) setHitPointDamage (_this select 1)}", _sink] call EFUNC(common,execRemoteFnc);
|
|
||||||
} else {
|
|
||||||
_target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]];
|
|
||||||
};
|
|
||||||
_target setVariable [QGVAR(engineHit), nil, true];
|
_target setVariable [QGVAR(engineHit), nil, true];
|
||||||
},
|
},
|
||||||
"",
|
"",
|
||||||
|
@ -27,11 +27,7 @@ REFUEL_HOLSTER_WEAPON
|
|||||||
private _endPosOffset = [0, 0, 0];
|
private _endPosOffset = [0, 0, 0];
|
||||||
if (isNull _nozzle) then { // func is called on fuel truck
|
if (isNull _nozzle) then { // func is called on fuel truck
|
||||||
_target setVariable [QGVAR(engineHit), _target getHitPointDamage "HitEngine", true];
|
_target setVariable [QGVAR(engineHit), _target getHitPointDamage "HitEngine", true];
|
||||||
if !(local _target) then {
|
["setVanillaHitPointDamage", _target, [_target, ["HitEngine", 1]] ] call EFUNC(common,objectEvent);
|
||||||
[[_target, ["HitEngine", 1]], "{(_this select 0) setHitPointDamage (_this select 1)}", _sink] call EFUNC(common,execRemoteFnc);
|
|
||||||
} else {
|
|
||||||
_target setHitPointDamage ["HitEngine", 1];
|
|
||||||
};
|
|
||||||
|
|
||||||
_target setVariable [QGVAR(isConnected), true, true];
|
_target setVariable [QGVAR(isConnected), true, true];
|
||||||
_endPosOffset = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks));
|
_endPosOffset = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks));
|
||||||
|
Loading…
Reference in New Issue
Block a user