Small optimizations

This commit is contained in:
Wyqer 2019-06-18 15:54:49 +02:00
parent 6b826f4216
commit bb27fb8312
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
3 changed files with 9 additions and 6 deletions

View File

@ -8,8 +8,7 @@ if (_negative) then {
KP_liberation_civ_rep = KP_liberation_civ_rep + _amount;
};
if (KP_liberation_civ_rep < -100) then {KP_liberation_civ_rep = -100;};
if (KP_liberation_civ_rep > 100) then {KP_liberation_civ_rep = 100;};
KP_liberation_civ_rep = -100 max (KP_liberation_civ_rep min 100);
// Set correct resistance standing
private _resistanceEnemy = [0, 1] select (KP_liberation_civ_rep < 25);

View File

@ -18,6 +18,10 @@ switch (_fac) do {
{
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 {};

View File

@ -4,6 +4,10 @@ params ["_price_s", "_price_a", "_price_f", "_typename", "_localtype", "_storage
if ((_price_s > 0) || (_price_a > 0) || (_price_f > 0)) 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_positions = [];
private _storedCrates = (attachedObjects _x);
@ -93,9 +97,5 @@ if ((_price_s > 0) || (_price_a > 0) || (_price_f > 0)) 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;
please_recalculate = true;
};