mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Replacing execRemoteFnc with events
This commit is contained in:
parent
6cce74907f
commit
8dc99a4a4e
@ -6,3 +6,15 @@
|
||||
if (isServer) then {
|
||||
addMissionEventHandler ["HandleDisconnect", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}];
|
||||
};
|
||||
|
||||
[QGVAR(makeDummyEH), {
|
||||
_this call FUNC(makeDummy);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
[QGVAR(rearmEntireVehicleSuccessLocalEH), {
|
||||
_this call FUNC(rearmEntireVehicleSuccessLocal);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
[QGVAR(rearmSuccessLocalEH), {
|
||||
_this call FUNC(rearmSuccessLocal);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
@ -23,6 +23,6 @@ if !(isNull _attachedDummy) exitWith {};
|
||||
|
||||
_dummy attachTo [_unit, [0,1,0], "pelvis"];
|
||||
{
|
||||
[[_dummy, [[-1,0,0],[0,0,1]]], QFUNC(makeDummy), _x] call EFUNC(common,execRemoteFnc);
|
||||
[QGVAR(makeDummyEH), _x, [_dummy, [[-1,0,0],[0,0,1]]]] call EFUNC(common,objectEvent);
|
||||
} count (position _unit nearObjects ["CAManBase", 100]);
|
||||
_unit setVariable [QGVAR(dummy), _dummy];
|
||||
|
@ -24,10 +24,9 @@ if (isServer) then {
|
||||
{
|
||||
_turretOwnerID = _vehicle turretOwner _x;
|
||||
if (_turretOwnerID == 0) then {
|
||||
[[_truck, _vehicle, _x], QFUNC(rearmEntireVehicleSuccessLocal), _truck] call EFUNC(common,execRemoteFnc);
|
||||
[QGVAR(rearmEntireVehicleSuccessLocalEH), _truck, [_truck, _vehicle, _x]] call EFUNC(common,objectEvent);
|
||||
} else {
|
||||
EGVAR(common,remoteFnc) = [[_truck, _vehicle, _x], QFUNC(rearmEntireVehicleSuccessLocal), 0];
|
||||
_turretOwnerID publicVariableClient QEGVAR(common,remoteFnc);
|
||||
[QGVAR(rearmEntireVehicleSuccessLocalEH), _turretOwnerID, [_truck, _vehicle, _x]] call EFUNC(common,targetEvent);
|
||||
};
|
||||
} count REARM_TURRET_PATHS;
|
||||
} else {
|
||||
|
@ -33,10 +33,9 @@ if (local _unit) then {
|
||||
if (isServer) then {
|
||||
private _turretOwnerID = _vehicle turretOwner _turretPath;
|
||||
if (_turretOwnerID == 0) then {
|
||||
[_this, QFUNC(rearmSuccessLocal), _vehicle] call EFUNC(common,execRemoteFnc);
|
||||
[QGVAR(rearmSuccessLocalEH), _vehicle, _this] call EFUNC(common,objectEvent);
|
||||
} else {
|
||||
EGVAR(common,remoteFnc) = [_this, QFUNC(rearmSuccessLocal), 0];
|
||||
_turretOwnerID publicVariableClient QEGVAR(common,remoteFnc);
|
||||
[QGVAR(rearmSuccessLocalEH), _turretOwnerID, _this] call EFUNC(common,targetEvent);
|
||||
};
|
||||
} else {
|
||||
[_this, QFUNC(rearmSuccess), 1] call EFUNC(common,execRemoteFnc);
|
||||
|
Loading…
Reference in New Issue
Block a user