Fix 3rd party air and sea vehicle fuel capacity (#4554)

* Fix fuel capacity for air vehicles

* Sea vehicles as well, minor empty classes cleanup
This commit is contained in:
jonpas 2016-10-18 20:21:28 +02:00 committed by Glowbal
parent 19fe4016e5
commit 877944ddce
2 changed files with 11 additions and 27 deletions

View File

@ -180,18 +180,13 @@ class CfgVehicles {
class Helicopter: Air {
MACRO_CONNECT_ACTIONS
GVAR(fuelCapacity) = 1500;
};
class Helicopter_Base_F: Helicopter {};
class Helicopter_Base_H: Helicopter_Base_F {
GVAR(fuelCapacity) = 3000;
};
class Helicopter_Base_H: Helicopter_Base_F {};
class Plane: Air {
MACRO_CONNECT_ACTIONS
GVAR(fuelCapacity) = 2000;
GVAR(flowRate) = 16;
};
@ -201,7 +196,6 @@ class CfgVehicles {
class Ship_F: Ship {
MACRO_CONNECT_ACTIONS
GVAR(fuelCapacity) = 2000;
GVAR(flowRate) = 4;
};
@ -373,19 +367,6 @@ class CfgVehicles {
GVAR(fuelCapacity) = 830;
};
class Heli_Attack_01_base_F: Helicopter_Base_F {
// Commanche
};
class Heli_Attack_02_base_F: Helicopter_Base_F {
// Mi-48 Kajman
};
class Heli_Light_01_base_F: Helicopter_Base_H {
// MH-6
GVAR(fuelCapacity) = 242;
};
class Heli_Light_02_base_F: Helicopter_Base_H {
// Ka-60 Kasatka
GVAR(fuelCapacity) = 1450;
@ -439,11 +420,6 @@ class CfgVehicles {
GVAR(fuelCapacity) = 270;
};
class UGV_01_base_F: Car_F {
// Stomper
GVAR(fuelCapacity) = 100;
};
class Plane_Fighter_03_base_F: Plane_Base_F {
// L-159 ALCA
GVAR(fuelCapacity) = 1914;

View File

@ -18,8 +18,16 @@
params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_nozzle", objNull, [objNull]], ["_connectToPoint", [0,0,0], [[]], 3]];
private _rate = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(flowRate)) * GVAR(rate);
private _maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(fuelCapacity));
private _config = configFile >> "CfgVehicles" >> typeOf _target;
private _rate = getNumber (_config >> QGVAR(flowRate)) * GVAR(rate);
private _maxFuel = getNumber (_config >> QGVAR(fuelCapacity));
// Fall back to vanilla fuelCapacity value (only air and sea vehicles don't have this defined by default by us)
// Air and sea vehicles have that value properly defined in liters, unlike ground vehicles which is is formula of (range * tested factor) - different fuel consumption system than ground vehicles
if (_maxFuel == 0) then {
_maxFuel = getNumber (_config >> "fuelCapacity");
};
[{
params ["_args", "_pfID"];