Add setting to disable base takeover #1886

No classes inherit from Generator_DZ, so there is no need to use
isKindOf over typeOf.
This commit is contained in:
ebaydayz
2017-02-01 12:16:16 -05:00
parent 9f7ae93bef
commit 6aa5c9b64f
7 changed files with 22 additions and 24 deletions

View File

@@ -76,7 +76,7 @@ if (_build) then {
};
/* //set fuel, Later use Generator
if (_object isKindOf "Generator_DZ") then {
if (typeOf _object == "Generator_DZ") then {
diag_log format["Object: %1, Fuel: %2",_object,fuel _object];
if (local _object) then {
_object setFuel 0;

View File

@@ -1,14 +1,15 @@
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_24" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling","_array","_cantype",
"_emptycan","_started","_finished","_animState","_isRefuel"];
"_emptycan","_started","_finished","_animState","_isRefuel","_type"];
_array = _this select 3;
_cantype = _array select 0;
_vehicle = _array select 1;
_type = typeOf _vehicle;
_canSize = getNumber(configFile >> "cfgMagazines" >> _cantype >> "fuelQuantity");
_emptycan = getText(configFile >> "cfgMagazines" >> _cantype >> "emptycan");
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_configVeh = configFile >> "cfgVehicles" >> _type;
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameType = getText(_configVeh >> "displayName");
_curFuel = ((fuel _vehicle) * _capacity);
@@ -57,7 +58,7 @@ if (!_fueling) then {
r_doLoop = false;
if (_finished) then {
if((_vehicle isKindOf "Generator_DZ") && {!(_vehicle getVariable ["GeneratorFilled", false])}) then {
if ((_type == "Generator_DZ") && {!(_vehicle getVariable ["GeneratorFilled", false])}) then {
_vehicle setVariable ["GeneratorFilled", true, true];
};
if (local _vehicle) then {

View File

@@ -130,8 +130,8 @@ while {_isOk} do {
if(_finished) then {
_counter = _counter + 1;
// 4% chance to break a required tool each pass
if((_isDestructable || _isRemovable) && !_isOwnerOfObj) then {
if (dayz_toolBreaking && {[0.04] call fn_chance}) then {_brokenTool = true;};
if ((_isDestructable || _isRemovable) && {!_isOwnerOfObj} && {dayz_toolBreaking && {[0.04] call fn_chance}}) then {
_brokenTool = true;
};
};
if(_brokenTool) exitWith {