Add Ability to Change Repair Times of Vehicles (#5205)

* Add ability to change repair time based on vehicle

* Much better

* Unary command not function

* Allow changing of track or wheel object per vehicle

* Lot more complicated than I thought
This commit is contained in:
Ozan Eğitmen 2017-06-08 22:31:25 +04:00 committed by PabstMirror
parent 55df8bca53
commit 225d15dcca

View File

@ -177,23 +177,31 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then {
[_caller, _callerAnim] call EFUNC(common,doAnimation);
};
//Get repair time
_repairTime = if (isNumber (_config >> "repairingTime")) then {
getNumber (_config >> "repairingTime");
} else {
if (isText (_config >> "repairingTime")) exitWith {
_repairTimeConfig = getText(_config >> "repairingTime");
if (isNil _repairTimeConfig) then {
_repairTimeConfig = compile _repairTimeConfig;
} else {
_repairTimeConfig = missionNamespace getVariable _repairTimeConfig;
// Get repair time
_repairTime = [
configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(repairTimes) >> configName _config,
"number",
-1
] call CBA_fnc_getConfigEntry;
if (_repairTime < 0) then {
_repairTime = if (isNumber (_config >> "repairingTime")) then {
getNumber (_config >> "repairingTime");
} else {
if (isText (_config >> "repairingTime")) exitWith {
_repairTimeConfig = getText (_config >> "repairingTime");
if (isNil _repairTimeConfig) then {
_repairTimeConfig = compile _repairTimeConfig;
} else {
_repairTimeConfig = missionNamespace getVariable _repairTimeConfig;
};
if (_repairTimeConfig isEqualType 0) exitWith {
_repairTimeConfig;
};
[_caller, _target, _hitPoint, _className] call _repairTimeConfig;
};
if (_repairTimeConfig isEqualType 0) exitWith {
_repairTimeConfig;
};
[_caller, _target, _hitPoint, _className] call _repairTimeConfig;
0;
};
0;
};
// Find localized string