mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Remove initial spare part adding for classes not Car or Tank, Improve addSpareParts
This commit is contained in:
parent
5147f366a5
commit
58cc686aac
@ -22,32 +22,29 @@ class Extended_InitPost_EventHandlers {
|
||||
class Car {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
serverInit = QUOTE([ARR_3(_this select 0,1,'ACE_Wheel')] call DFUNC(addSpareParts));
|
||||
};
|
||||
};
|
||||
class Tank {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
serverInit = QUOTE([ARR_3(_this select 0,1,'ACE_Wheel')] call DFUNC(addSpareParts));
|
||||
};
|
||||
};
|
||||
class Helicopter {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
exclude[] = {QEGVAR(fastroping,helper), "ACE_friesBase"};
|
||||
};
|
||||
};
|
||||
class Plane {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
};
|
||||
};
|
||||
class Ship_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -21,8 +21,8 @@
|
||||
params ["_vehicle", ["_amount", 1], ["_part", ""], ["_force", false]];
|
||||
TRACE_2("params",_vehicle,_amount);
|
||||
|
||||
// Exit if ace_cargo is not loaded
|
||||
if !(["ace_cargo"] call EFUNC(common,isModLoaded)) exitWith {};
|
||||
// Exit if ace_cargo is not loaded or no part supplied
|
||||
if (!(["ace_cargo"] call EFUNC(common,isModLoaded)) || {_part == ""}) exitWith {};
|
||||
|
||||
// Collect until SettingsInitialized
|
||||
if (!EGVAR(common,settingsInitFinished)) exitWith {
|
||||
@ -32,13 +32,5 @@ if (!EGVAR(common,settingsInitFinished)) exitWith {
|
||||
// Exit if not forced and add spare parts is disabled (after settings initted to make sure it really is)
|
||||
if (!_force && !GVAR(addSpareParts)) exitWith {};
|
||||
|
||||
// Select appropriate part
|
||||
if (_part == "") then {
|
||||
if (_vehicle isKindOf "Car") then { _part = "ACE_Wheel" };
|
||||
if (_vehicle isKindOf "Tank") then { _part = "ACE_Track" };
|
||||
};
|
||||
// Exit if no appropriate part
|
||||
if (_part == "") exitWith {};
|
||||
|
||||
// Load
|
||||
["AddCargoByClass", [_part, _vehicle, _amount]] call EFUNC(common,localEvent);
|
||||
|
Loading…
Reference in New Issue
Block a user