Remove initial spare part adding for classes not Car or Tank, Improve addSpareParts

This commit is contained in:
jonpas 2016-05-12 21:49:45 +02:00
parent 5147f366a5
commit 58cc686aac
2 changed files with 4 additions and 15 deletions

View File

@ -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));
};
};
};

View File

@ -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);