fixes and spaces

This commit is contained in:
bux578 2015-01-13 15:28:03 +01:00
parent 5ffe1fa3e5
commit 425be3a6c2
18 changed files with 173 additions and 173 deletions

View File

@ -1,20 +1,20 @@
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); init = QUOTE( call COMPILE_FILE(XEH_preInit) );
}; };
}; };
class Extended_Killed_EventHandlers { class Extended_Killed_EventHandlers {
class CAManBase { class CAManBase {
class GVAR(HandleGear) { class GVAR(HandleGear) {
killed = QUOTE( _this call FUNC(handleKilled) ); killed = QUOTE( _this call FUNC(handleKilled) );
};
}; };
};
}; };
class Extended_Respawn_EventHandlers { class Extended_Respawn_EventHandlers {
class CAManBase { class CAManBase {
class GVAR(HandleGear) { class GVAR(HandleGear) {
respawn = QUOTE( _this call FUNC(handleRespawn) ); respawn = QUOTE( _this call FUNC(handleRespawn) );
};
}; };
};
}; };

View File

@ -1,5 +1,5 @@
class CfgVehicleClasses { class CfgVehicleClasses {
class GVAR(Rallypoints) { class GVAR(Rallypoints) {
displayName = "ACE Respawn"; displayName = "ACE Respawn";
}; };
}; };

View File

@ -1,17 +1,17 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent"}; weapons[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent"};
requiredVersion = 0.60; requiredVersion = 0.60;
requiredAddons[] = {"ace_core"}; requiredAddons[] = {"ace_core"};
version = QUOTE(VERSION); version = QUOTE(VERSION);
versionStr = QUOTE(VERSION); versionStr = QUOTE(VERSION);
versionAr[] = {VERSION_AR}; versionAr[] = {VERSION_AR};
author[] = {"bux578", "commy2"}; author[] = {"bux578", "commy2"};
authorUrl = "https://github.com/bux578/"; authorUrl = "https://github.com/bux578/";
}; };
}; };
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
@ -20,7 +20,6 @@ class CfgPatches {
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
class ACE_Parameters_Boolean { class ACE_Parameters_Boolean {
// Boolean Parameters (0/1) GVAR(SavePreDeathGear) = 0;
GVAR(SavePreDeathGear) = 0; GVAR(RemoveDeadBodiesDisonncected) = 1;
GVAR(RemoveDeadBodiesDisonncected) = 1;
}; };

View File

@ -26,8 +26,8 @@ _side = _this select 1;
_unit getVariable ["ACE_canMoveRallypoint"), false] _unit getVariable ["ACE_canMoveRallypoint"), false]
&& {!isNull ([ && {!isNull ([
objNull, objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_Rallypoint_East", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
] select ([west, east, independent] find _side) + 1)} ] select ([west, east, independent] find _side) + 1)}

View File

@ -21,25 +21,25 @@ private ["_unit", "_allGear"];
_unit = _this select 0; _unit = _this select 0;
_allGear = [ _allGear = [
(headgear _unit), (headgear _unit),
(goggles _unit), (goggles _unit),
(uniform _unit), (uniform _unit),
(uniformItems _unit), (uniformItems _unit),
(vest _unit), (vest _unit),
(vestItems _unit), (vestItems _unit),
(backpack _unit), (backpack _unit),
(backpackItems _unit), (backpackItems _unit),
(primaryWeapon _unit), (primaryWeapon _unit),
(primaryWeaponItems _unit), (primaryWeaponItems _unit),
(primaryWeaponMagazine _unit), (primaryWeaponMagazine _unit),
(secondaryWeapon _unit), (secondaryWeapon _unit),
(secondaryWeaponItems _unit), (secondaryWeaponItems _unit),
(secondaryWeaponMagazine _unit), (secondaryWeaponMagazine _unit),
(handgunWeapon _unit), (handgunWeapon _unit),
(handgunItems _unit), (handgunItems _unit),
(handgunMagazine _unit), (handgunMagazine _unit),
(assignedItems _unit), (assignedItems _unit),
(binocular _unit) (binocular _unit)
]; ];
_allGear _allGear

View File

@ -25,9 +25,9 @@ _killedUnit = _this select 0;
GVAR(unitGear) = []; GVAR(unitGear) = [];
if (GVAR(SavePreDeathGear)) then { if (GVAR(SavePreDeathGear)) then {
GVAR(unitGear) = [_killedUnit] call FUNC(getAllGear); GVAR(unitGear) = [_killedUnit] call FUNC(getAllGear);
}; };
if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then { if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then {
[_this, FUNC(showFriendlyFireMessage), 2] call EFUNC(Core, execRemoteFnc); [_this, FUNC(showFriendlyFireMessage), 2] call EFUNC(Core,execRemoteFnc);
}; };

View File

@ -23,5 +23,5 @@ _respawnedUnit = _this select 0;
// Restores the gear when the player respawns // Restores the gear when the player respawns
if (GVAR(SavePreDeathGear)) then { if (GVAR(SavePreDeathGear)) then {
[_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear); [_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear);
}; };

View File

@ -25,9 +25,9 @@ if (!local _rallypoint) exitWith {};
_name = typeOf _rallypoint; _name = typeOf _rallypoint;
if (isNil _name) then { if (isNil _name) then {
missionNamespace setVariable [_name, _rallypoint]; missionNamespace setVariable [_name, _rallypoint];
publicVariable _name; publicVariable _name;
} else { } else {
deleteVehicle _rallypoint; deleteVehicle _rallypoint;
diag_log text "[ACE] Respawn: ERROR Multiple Rallypoints of same type."; diag_log text "[ACE] Respawn: ERROR Multiple Rallypoints of same type.";
}; };

View File

@ -27,26 +27,26 @@ if !(_activated) exitWith {};
GVAR(Module) = true; GVAR(Module) = true;
[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(Core, readBooleanParameterFromModule); [_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(Core,readBooleanParameterFromModule);
[_logic, QGVAR(RemoveDeadBodiesDisonncected), "RemoveDeadBodiesDisonncected"] call EFUNC(Core, readBooleanParameterFromModule); [_logic, QGVAR(RemoveDeadBodiesDisonncected), "RemoveDeadBodiesDisonncected"] call EFUNC(Core,readBooleanParameterFromModule);
if (isServer) then { if (isServer) then {
if (GVAR(RemoveDeadBodiesDisonncected)) then { if (GVAR(RemoveDeadBodiesDisonncected)) then {
_fnc_deleteDisconnected = { _fnc_deleteDisconnected = {
_this spawn { _this spawn {
_unit = _this select 0; _unit = _this select 0;
sleep 4; sleep 4;
if (!alive _unit) then { if (!alive _unit) then {
deleteVehicle _unit; deleteVehicle _unit;
};
};
false
}; };
};
false
};
addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected]; addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected];
}; };
}; };
diag_log text "[ACE]: Respawn Module Initialized."; diag_log text "[ACE]: Respawn Module Initialized.";

View File

@ -19,18 +19,18 @@
#include "script_component.hpp" #include "script_component.hpp"
_this spawn { _this spawn {
_logic = _this select 0; _logic = _this select 0;
_units = _this select 1; _units = _this select 1;
_activated = _this select 2; _activated = _this select 2;
if !(_activated) exitWith {}; if !(_activated) exitWith {};
if (isServer) then { if (isServer) then {
_varName = QGVAR(showFriendlyFireMessage); _varName = QGVAR(showFriendlyFireMessage);
missionNamespace setVariable [_varName, true]; missionNamespace setVariable [_varName, true];
publicVariable _varName; publicVariable _varName;
}; };
diag_log text "[ACE]: Friendly Fire Messages Module Initialized."; diag_log text "[ACE]: Friendly Fire Messages Module Initialized.";
}; };

View File

@ -25,7 +25,7 @@ _activated = _this select 2;
if !(_activated) exitWith {}; if !(_activated) exitWith {};
{ {
_x setVariable ["ACE_canMoveRallypoint", true]; _x setVariable ["ACE_canMoveRallypoint", true];
} forEach _units; } forEach _units;
diag_log text "[ACE]: Rallypoint Module Initialized."; diag_log text "[ACE]: Rallypoint Module Initialized.";

View File

@ -18,37 +18,37 @@
#include "script_component.hpp" #include "script_component.hpp"
_this spawn { _this spawn {
_unit = _this select 0; _unit = _this select 0;
_side = _this select 1; _side = _this select 1;
// rallypoint names are defined in CfgVehicles.hpp // rallypoint names are defined in CfgVehicles.hpp
_rallypoint = [
objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
] select ([west, east, independent] find _side) + 1;
if (isNull _rallypoint) exitWith {}; _rallypoint = [
objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
] select ([west, east, independent] find _side) + 1;
_position = getPosATL _unit; if (isNull _rallypoint) exitWith {};
_position = _position findEmptyPosition [0, 2, typeOf _rallypoint];
if (count _position == 0) then {_position = getPosATL _unit};
_position set [2, 0]; _position = getPosATL _unit;
_position = _position findEmptyPosition [0, 2, typeOf _rallypoint];
if (count _position == 0) then {_position = getPosATL _unit};
[localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core, displayTextStructured); _position set [2, 0];
sleep 5; [localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core,displayTextStructured);
_rallypoint setPosATL _position;
_unit reveal _rallypoint;
/* sleep 5;
_marker = format ["AGM_RallyPoint_%1", _side]; _rallypoint setPosATL _position;
_marker setMarkerPos _position; _unit reveal _rallypoint;
_marker setMarkerTextLocal format ["%1:%2", [date select 3, 2, 0] call CBA_fnc_FORMATNumber, [date select 4, 2, 0] call CBA_fnc_FORMATNumber];
*/
[localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core, displayTextStructured); /*
_marker = format ["AGM_RallyPoint_%1", _side];
_marker setMarkerPos _position;
_marker setMarkerTextLocal format ["%1:%2", [date select 3, 2, 0] call CBA_fnc_FORMATNumber, [date select 4, 2, 0] call CBA_fnc_FORMATNumber];
*/
[localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core,displayTextStructured);
}; };

View File

@ -30,8 +30,8 @@ if (_forceRemove) then {
}; };
[_body, _bodyRemoveTimer] spawn { [_body, _bodyRemoveTimer] spawn {
sleep (_this select 1); sleep (_this select 1);
// hideBody takes ~20s till body is fully underground // hideBody takes ~20s till body is fully underground
// a better hideBody would make this more aesthetic // a better hideBody would make this more aesthetic
deleteVehicle (_this select 0); deleteVehicle (_this select 0);
}; };

View File

@ -21,11 +21,11 @@ private ["_forceRemove", "_body"];
_forceRemove = _this select 0; _forceRemove = _this select 0;
{ {
if (getPlayerUID _x == _uid) exitWith { if (getPlayerUID _x == _uid) exitWith {
_body = _x; _body = _x;
}; };
} forEach playableUnits; } forEach playableUnits;
if (!isNil "_body" && {!alive _body}) then { if (!isNil "_body" && {!alive _body}) then {
[_body, _forceRemove] call FUNC(removeBody); [_body, _forceRemove] call FUNC(removeBody);
}; };

View File

@ -56,85 +56,85 @@ _binocular = _allGear select 18;
// start restoring the items // start restoring the items
if (_headgear != "") then { if (_headgear != "") then {
_unit addHeadgear _headgear; _unit addHeadgear _headgear;
}; };
if (_uniform != "") then { if (_uniform != "") then {
_unit forceAddUniform _uniform; _unit forceAddUniform _uniform;
}; };
if (_vest != "") then { if (_vest != "") then {
_unit addVest _vest; _unit addVest _vest;
}; };
if (_goggles != "") then { if (_goggles != "") then {
_unit addGoggles _goggles; _unit addGoggles _goggles;
}; };
{ {
_unit addItemToUniform _x; _unit addItemToUniform _x;
}forEach _uniformitems; }forEach _uniformitems;
{ {
_unit addItemToVest _x; _unit addItemToVest _x;
}forEach _vestitems; }forEach _vestitems;
if(format["%1", _backpack] != "") then { if(format["%1", _backpack] != "") then {
_unit addBackpack _backpack; _unit addBackpack _backpack;
_backpa = unitBackpack _unit; _backpa = unitBackpack _unit;
clearMagazineCargoGlobal _backpa; clearMagazineCargoGlobal _backpa;
clearWeaponCargoGlobal _backpa; clearWeaponCargoGlobal _backpa;
clearItemCargoGlobal _backpa; clearItemCargoGlobal _backpa;
{ {
_unit addItemToBackpack _x; _unit addItemToBackpack _x;
} forEach _backpackitems; } forEach _backpackitems;
}; };
// primaryWeapon // primaryWeapon
if (_primaryweapon != "") then { if (_primaryweapon != "") then {
{ {
_unit addMagazine _x; _unit addMagazine _x;
} forEach _primaryweaponmagazine; } forEach _primaryweaponmagazine;
_unit addWeapon _primaryweapon; _unit addWeapon _primaryweapon;
{ {
if (_x != "") then { if (_x != "") then {
_unit addPrimaryWeaponItem _x; _unit addPrimaryWeaponItem _x;
}; };
} forEach _primaryweaponitems; } forEach _primaryweaponitems;
}; };
// secondaryWeapon // secondaryWeapon
if (_secondaryweapon != "") then { if (_secondaryweapon != "") then {
{ {
_unit addMagazine _x; _unit addMagazine _x;
} forEach _secondaryweaponmagazine; } forEach _secondaryweaponmagazine;
_unit addWeapon _secondaryweapon; _unit addWeapon _secondaryweapon;
{ {
if (_x != "") then { if (_x != "") then {
_unit addSecondaryWeaponItem _x; _unit addSecondaryWeaponItem _x;
}; };
} forEach _secondaryweaponitems; } forEach _secondaryweaponitems;
}; };
// handgun // handgun
if (_handgunweapon != "") then { if (_handgunweapon != "") then {
{ {
_unit addMagazine _x; _unit addMagazine _x;
} forEach _handgunweaponmagazine; } forEach _handgunweaponmagazine;
_unit addWeapon _handgunweapon; _unit addWeapon _handgunweapon;
{ {
if (_x != "") then { if (_x != "") then {
_unit addHandgunItem _x; _unit addHandgunItem _x;
}; };
} forEach _handgunweaponitems; } forEach _handgunweaponitems;
}; };
@ -146,6 +146,6 @@ _assignedItems = _assignedItems - [_binocular];
_unit addWeapon _binocular; _unit addWeapon _binocular;
if ("Laserdesignator" in assignedItems _unit) then { if ("Laserdesignator" in assignedItems _unit) then {
_unit selectWeapon "Laserdesignator"; _unit selectWeapon "Laserdesignator";
if (currentMagazine _unit == "") then {_unit addMagazine "Laserbatteries";}; if (currentMagazine _unit == "") then {_unit addMagazine "Laserbatteries";};
}; };

View File

@ -23,7 +23,7 @@ _unit = _this select 0;
_killer = _this select 1; _killer = _this select 1;
if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then { if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then {
systemChat format ["%1 was killed by %2", [_unit] call EFUNC(Core, getName), [_killer] call EFUNC(Core, getName)]; systemChat format ["%1 was killed by %2", [_unit] call EFUNC(Core,getName), [_killer] call EFUNC(Core,getName)];
[_unit, "killedByFriendly", [_unit, _killer]] call EFUNC(Core, callCustomEventHandlers); [_unit, "killedByFriendly", [_unit, _killer]] call EFUNC(Core,callCustomEventHandlers);
}; };

View File

@ -27,18 +27,18 @@ _toBase = _this select 2;
// rallypoint names are defined in CfgVehicles.hpp // rallypoint names are defined in CfgVehicles.hpp
_rallypoint = ([ _rallypoint = ([
[ [
objNull, objNull,
missionNamespace getVariable ["ACE_RallypointExit_West", objNull], missionNamespace getVariable ["ACE_RallypointExit_West", objNull],
missionNamespace getVariable ["ACE_RallypointExit_East", objNull], missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull] missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
], ],
[ [
objNull, objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_Rallypoint_East", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
] ]
] select _toBase) select ([west, east, independent] find _side) + 1; ] select _toBase) select ([west, east, independent] find _side) + 1;
if (isNull _rallypoint) exitWith {}; if (isNull _rallypoint) exitWith {};

View File

@ -0,0 +1 @@
#include "\z\ace\addons\respawn\script_component.hpp"