mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Move setVectorDirAndUp and setHitPointDamage events to common, Make refuel set nozzle position execute only on target where local
This commit is contained in:
parent
589ca27b60
commit
881eaf951a
@ -158,6 +158,9 @@ if (isServer) then {
|
||||
["enableSimulationGlobal", {(_this select 0) enableSimulationGlobal (_this select 1)}] call FUNC(addEventHandler);
|
||||
};
|
||||
|
||||
["setVectorDirAndUp", {(_this select 0) setVectorDirAndUp (_this select 1)}] call FUNC(addEventHandler);
|
||||
["setHitPointDamage", {(_this select 0) setHitPointDamage (_this select 1)}] call FUNC(addEventHandler);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Set up remote execution
|
||||
|
@ -6,19 +6,6 @@ if (isServer) then {
|
||||
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}];
|
||||
};
|
||||
|
||||
// @todo move to common?
|
||||
[QGVAR(setVectorDirAndUp), {
|
||||
params ["_vehicle", "_vectorDirAndUp"];
|
||||
|
||||
if (local _vehicle) then {
|
||||
(_this select 0) setVectorDirAndUp (_this select 1)
|
||||
};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
[QGVAR(setVehicleHitPointDamage), {
|
||||
(_this select 0) setHitPointDamage (_this select 1);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
[QGVAR(resetLocal), {
|
||||
_this call FUNC(resetLocal);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
@ -119,7 +119,7 @@ _endPosTestOffset set [2, (_startingOffset select 2)];
|
||||
};
|
||||
};
|
||||
};
|
||||
[QGVAR(setVectorDirAndUp), [_nozzle, _dirAndUp]] call EFUNC(common,globalEvent);
|
||||
["setVectorDirAndUp", _nozzle, [_nozzle, _dirAndUp]] call EFUNC(common,targetEvent);
|
||||
_nozzle setVariable [QGVAR(sink), _target, true];
|
||||
_nozzle setVariable [QGVAR(isConnected), true, true];
|
||||
_target setVariable [QGVAR(nozzle), _nozzle, true];
|
||||
|
@ -20,7 +20,7 @@ params [["_target", objNull, [objNull]]];
|
||||
if (local _target) then {
|
||||
_target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]];
|
||||
} else {
|
||||
[QGVAR(setVehicleHitPointDamage), _target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]] call EFUNC(common,targetEvent);
|
||||
["setHitPointDamage", _target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]] call EFUNC(common,targetEvent);
|
||||
};
|
||||
_target setVariable [QGVAR(engineHit), nil, true];
|
||||
_target setVariable [QGVAR(isConnected), false, true];
|
||||
|
@ -49,7 +49,7 @@ if (isNull _nozzle || {_source != _target}) exitWith {false};
|
||||
deleteVehicle _nozzle;
|
||||
|
||||
if !(local _target) then {
|
||||
[QGVAR(setVehicleHitPointDamage), _target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]] call EFUNC(common,targetEvent);
|
||||
["setHitPointDamage", _target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]] call EFUNC(common,targetEvent);
|
||||
} else {
|
||||
_target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]];
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ private _endPosOffset = [0, 0, 0];
|
||||
if (isNull _nozzle) then { // func is called on fuel truck
|
||||
_target setVariable [QGVAR(engineHit), _target getHitPointDamage "HitEngine", true];
|
||||
if !(local _target) then {
|
||||
[QGVAR(setVehicleHitPointDamage), _target, ["HitEngine", 1]] call EFUNC(common,targetEvent);
|
||||
["setHitPointDamage", _target, ["HitEngine", 1]] call EFUNC(common,targetEvent);
|
||||
} else {
|
||||
_target setHitPointDamage ["HitEngine", 1];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user