Equalize indentation

This commit is contained in:
Wyqer 2019-06-26 15:21:12 +02:00
parent 461682cc1a
commit e0d6502342
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
3 changed files with 168 additions and 168 deletions

View File

@ -3,16 +3,16 @@ params ["_vehicle"];
if (KP_liberation_civrep_debug > 0) then {private _text = format ["[KP LIBERATION] [CIVREP] checkVehicle called on: %1 - Vehicle: %2", debug_source, _vehicle];_text remoteExec ["diag_log",2];};
if (isNil "KP_liberation_cr_vehicles") then {
KP_liberation_cr_vehicles = [];
KP_liberation_cr_vehicles = [];
};
if (((typeOf _vehicle) in civilian_vehicles) && !(_vehicle in KP_liberation_cr_vehicles)) then {
if (KP_liberation_civrep_debug > 0) then {private _text = format ["[KP LIBERATION] [CIVREP] Vehicle was stolen by: %1", debug_source];_text remoteExec ["diag_log",2];};
[0] remoteExec ["F_cr_globalMsg"];
[KP_liberation_cr_vehicle_penalty, true] remoteExec ["F_cr_changeCR", 2];
if (KP_liberation_civrep_debug > 0) then {private _text = format ["[KP LIBERATION] [CIVREP] Vehicle was stolen by: %1", debug_source];_text remoteExec ["diag_log",2];};
[0] remoteExec ["F_cr_globalMsg"];
[KP_liberation_cr_vehicle_penalty, true] remoteExec ["F_cr_changeCR", 2];
KP_liberation_cr_vehicles pushBack _vehicle;
publicVariable "KP_liberation_cr_vehicles";
KP_liberation_cr_vehicles pushBack _vehicle;
publicVariable "KP_liberation_cr_vehicles";
stats_civilian_vehicles_seized = stats_civilian_vehicles_seized + 1;
publicVariable "stats_civilian_vehicles_seized";

View File

@ -10,98 +10,98 @@ private _price_f = 100;
private _success = false;
switch (_fac) do {
case "supply": {_checkFor = 4;_price_s = 50};
case "ammo": {_checkFor = 5;_price_a = 50;};
case "fuel": {_checkFor = 6;_price_f = 50;};
case "supply": {_checkFor = 4;_price_s = 50};
case "ammo": {_checkFor = 5;_price_a = 50;};
case "fuel": {_checkFor = 6;_price_f = 50;};
};
{
if ((_x select 1) == (_sector select 1)) exitWith {
if (((_x select 9) >= _price_s) && ((_x select 10) >= _price_a) && ((_x select 11) >= _price_f)) then {
if ((_x select 1) == (_sector select 1)) exitWith {
if (((_x select 9) >= _price_s) && ((_x select 10) >= _price_a) && ((_x select 11) >= _price_f)) then {
stats_supplies_spent = stats_supplies_spent + _price_s;
stats_ammo_spent = stats_ammo_spent + _price_a;
stats_fuel_spent = stats_fuel_spent + _price_f;
private _storage = nearestObjects [(markerPos (_x select 1)), [KP_liberation_small_storage_building], GRLIB_fob_range];
_storage = _storage select {(_x getVariable ["KP_liberation_storage_type",-1]) == 1};
if ((count _storage) == 0) exitWith {};
_storage = (_storage select 0);
private _storedCrates = (attachedObjects _storage);
reverse _storedCrates;
private _storage = nearestObjects [(markerPos (_x select 1)), [KP_liberation_small_storage_building], GRLIB_fob_range];
_storage = _storage select {(_x getVariable ["KP_liberation_storage_type",-1]) == 1};
if ((count _storage) == 0) exitWith {};
_storage = (_storage select 0);
private _storedCrates = (attachedObjects _storage);
reverse _storedCrates;
{
private _crateValue = _x getVariable ["KP_liberation_crate_value",0];
{
private _crateValue = _x getVariable ["KP_liberation_crate_value",0];
switch ((typeOf _x)) do {
case KP_liberation_supply_crate: {
if (_price_s > 0) then {
if (_crateValue > _price_s) then {
_crateValue = _crateValue - _price_s;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_s = 0;
} else {
detach _x;
deleteVehicle _x;
_price_s = _price_s - _crateValue;
};
};
};
case KP_liberation_ammo_crate: {
if (_price_a > 0) then {
if (_crateValue > _price_a) then {
_crateValue = _crateValue - _price_a;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_a = 0;
} else {
detach _x;
deleteVehicle _x;
_price_a = _price_a - _crateValue;
};
};
};
case KP_liberation_fuel_crate: {
if (_price_f > 0) then {
if (_crateValue > _price_f) then {
_crateValue = _crateValue - _price_f;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_f = 0;
} else {
detach _x;
deleteVehicle _x;
_price_f = _price_f - _crateValue;
};
};
};
default {diag_log format ["[KP LIBERATION] [ERROR] Invalid object (%1) at storage area", (typeOf _x)];};
};
} forEach _storedCrates;
switch ((typeOf _x)) do {
case KP_liberation_supply_crate: {
if (_price_s > 0) then {
if (_crateValue > _price_s) then {
_crateValue = _crateValue - _price_s;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_s = 0;
} else {
detach _x;
deleteVehicle _x;
_price_s = _price_s - _crateValue;
};
};
};
case KP_liberation_ammo_crate: {
if (_price_a > 0) then {
if (_crateValue > _price_a) then {
_crateValue = _crateValue - _price_a;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_a = 0;
} else {
detach _x;
deleteVehicle _x;
_price_a = _price_a - _crateValue;
};
};
};
case KP_liberation_fuel_crate: {
if (_price_f > 0) then {
if (_crateValue > _price_f) then {
_crateValue = _crateValue - _price_f;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_f = 0;
} else {
detach _x;
deleteVehicle _x;
_price_f = _price_f - _crateValue;
};
};
};
default {diag_log format ["[KP LIBERATION] [ERROR] Invalid object (%1) at storage area", (typeOf _x)];};
};
} forEach _storedCrates;
private _i = 0;
{
private _height = 0.6;
switch (typeOf _x) do {
case KP_liberation_supply_crate: {_height = 0.4;};
case KP_liberation_ammo_crate: {_height = 0.6;};
case KP_liberation_fuel_crate: {_height = 0.3;};
default {_height = 0.6;};
};
detach _x;
_x attachTo [_storage, [(KP_liberation_small_storage_positions select _i) select 0, (KP_liberation_small_storage_positions select _i) select 1, _height]];
_i = _i + 1;
} forEach (attachedObjects _storage);
private _i = 0;
{
private _height = 0.6;
switch (typeOf _x) do {
case KP_liberation_supply_crate: {_height = 0.4;};
case KP_liberation_ammo_crate: {_height = 0.6;};
case KP_liberation_fuel_crate: {_height = 0.3;};
default {_height = 0.6;};
};
detach _x;
_x attachTo [_storage, [(KP_liberation_small_storage_positions select _i) select 0, (KP_liberation_small_storage_positions select _i) select 1, _height]];
_i = _i + 1;
} forEach (attachedObjects _storage);
_x set [_checkFor, true];
private _hint = format [localize "STR_PRODUCTION_FACBUILD_SUCCESS"];
_hint remoteExec ["hint",_clientID];
_success = true;
} else {
private _hint = format [localize "STR_PRODUCTION_FACBUILD_ERROR",_price_s,_price_a,_price_f];
_hint remoteExec ["hint",_clientID];
};
};
_x set [_checkFor, true];
private _hint = format [localize "STR_PRODUCTION_FACBUILD_SUCCESS"];
_hint remoteExec ["hint",_clientID];
_success = true;
} else {
private _hint = format [localize "STR_PRODUCTION_FACBUILD_ERROR",_price_s,_price_a,_price_f];
_hint remoteExec ["hint",_clientID];
};
};
} forEach _tempProduction;
if (_success) then {
KP_liberation_production = +_tempProduction;
recalculate_sectors = true;
KP_liberation_production = +_tempProduction;
recalculate_sectors = true;
};

View File

@ -8,94 +8,94 @@ if ((_price_s > 0) || (_price_a > 0) || (_price_f > 0)) then {
stats_ammo_spent = stats_ammo_spent + _price_a;
stats_fuel_spent = stats_fuel_spent + _price_f;
{
private _storage_positions = [];
private _storedCrates = (attachedObjects _x);
reverse _storedCrates;
{
private _storage_positions = [];
private _storedCrates = (attachedObjects _x);
reverse _storedCrates;
{
_crateValue = _x getVariable ["KP_liberation_crate_value",0];
{
_crateValue = _x getVariable ["KP_liberation_crate_value",0];
switch ((typeOf _x)) do {
case KP_liberation_supply_crate: {
if (_price_s > 0) then {
if (_crateValue > _price_s) then {
_crateValue = _crateValue - _price_s;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_s = 0;
} else {
detach _x;
deleteVehicle _x;
_price_s = _price_s - _crateValue;
};
};
};
case KP_liberation_ammo_crate: {
if (_price_a > 0) then {
if (_crateValue > _price_a) then {
_crateValue = _crateValue - _price_a;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_a = 0;
} else {
detach _x;
deleteVehicle _x;
_price_a = _price_a - _crateValue;
};
};
};
case KP_liberation_fuel_crate: {
if (_price_f > 0) then {
if (_crateValue > _price_f) then {
_crateValue = _crateValue - _price_f;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_f = 0;
} else {
detach _x;
deleteVehicle _x;
_price_f = _price_f - _crateValue;
};
};
};
default {diag_log format ["[KP LIBERATION] [ERROR] Invalid object (%1) at storage area", (typeOf _x)];};
};
} forEach _storedCrates;
switch ((typeOf _x)) do {
case KP_liberation_supply_crate: {
if (_price_s > 0) then {
if (_crateValue > _price_s) then {
_crateValue = _crateValue - _price_s;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_s = 0;
} else {
detach _x;
deleteVehicle _x;
_price_s = _price_s - _crateValue;
};
};
};
case KP_liberation_ammo_crate: {
if (_price_a > 0) then {
if (_crateValue > _price_a) then {
_crateValue = _crateValue - _price_a;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_a = 0;
} else {
detach _x;
deleteVehicle _x;
_price_a = _price_a - _crateValue;
};
};
};
case KP_liberation_fuel_crate: {
if (_price_f > 0) then {
if (_crateValue > _price_f) then {
_crateValue = _crateValue - _price_f;
_x setVariable ["KP_liberation_crate_value", _crateValue, true];
_price_f = 0;
} else {
detach _x;
deleteVehicle _x;
_price_f = _price_f - _crateValue;
};
};
};
default {diag_log format ["[KP LIBERATION] [ERROR] Invalid object (%1) at storage area", (typeOf _x)];};
};
} forEach _storedCrates;
switch (typeOf _x) do {
case KP_liberation_small_storage_building: {_storage_positions = KP_liberation_small_storage_positions;};
case KP_liberation_large_storage_building: {_storage_positions = KP_liberation_large_storage_positions;};
default {_storage_positions = KP_liberation_large_storage_positions;};
};
switch (typeOf _x) do {
case KP_liberation_small_storage_building: {_storage_positions = KP_liberation_small_storage_positions;};
case KP_liberation_large_storage_building: {_storage_positions = KP_liberation_large_storage_positions;};
default {_storage_positions = KP_liberation_large_storage_positions;};
};
private _area = _x;
_i = 0;
{
_height = 0.6;
switch (typeOf _x) do {
case KP_liberation_supply_crate: {_height = 0.4;};
case KP_liberation_ammo_crate: {_height = 0.6;};
case KP_liberation_fuel_crate: {_height = 0.3;};
default {_height = 0.6;};
};
detach _x;
_x attachTo [_area, [(_storage_positions select _i) select 0, (_storage_positions select _i) select 1, _height]];
_i = _i + 1;
} forEach attachedObjects (_x);
private _area = _x;
_i = 0;
{
_height = 0.6;
switch (typeOf _x) do {
case KP_liberation_supply_crate: {_height = 0.4;};
case KP_liberation_ammo_crate: {_height = 0.6;};
case KP_liberation_fuel_crate: {_height = 0.3;};
default {_height = 0.6;};
};
detach _x;
_x attachTo [_area, [(_storage_positions select _i) select 0, (_storage_positions select _i) select 1, _height]];
_i = _i + 1;
} forEach attachedObjects (_x);
if ((_price_s == 0) && (_price_a == 0) && (_price_f == 0)) exitWith {};
if ((_price_s == 0) && (_price_a == 0) && (_price_f == 0)) exitWith {};
} forEach _storage_areas;
} forEach _storage_areas;
if ( _localtype == 8 ) then {
stats_blufor_soldiers_recruited = stats_blufor_soldiers_recruited + 10;
} else {
if ( _typename isKindOf "Man" ) then {
stats_blufor_soldiers_recruited = stats_blufor_soldiers_recruited + 1;
} else {
if ( ! ( _typename isKindOf "Building" ) ) then {
stats_blufor_vehicles_built = stats_blufor_vehicles_built + 1;
};
};
};
if ( _localtype == 8 ) then {
stats_blufor_soldiers_recruited = stats_blufor_soldiers_recruited + 10;
} else {
if ( _typename isKindOf "Man" ) then {
stats_blufor_soldiers_recruited = stats_blufor_soldiers_recruited + 1;
} else {
if ( ! ( _typename isKindOf "Building" ) ) then {
stats_blufor_vehicles_built = stats_blufor_vehicles_built + 1;
};
};
};
please_recalculate = true;
please_recalculate = true;
};