fn_getSectorRange

This commit is contained in:
Wyqer 2019-12-07 10:45:24 +01:00
parent 8e2ac32de9
commit 0407c62377
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
1 changed files with 10 additions and 15 deletions

View File

@ -2,29 +2,24 @@
File: fn_getSectorRange.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-11-25
Last Update: 2019-11-25
Last Update: 2019-12-07
License: MIT License - http://www.opensource.org/licenses/MIT
Description:
No description added yet.
Gets the sector size with taking the given amount of units into account.
Parameter(s):
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
_unitCount - Number of units to take into account [NUMBER, defaults to 0]
Returns:
Function reached the end [BOOL]
Calculated sector size [NUMBER]
*/
// TODO
params ["_opforcount"];
private _corrected_sector_size = GRLIB_sector_size;
params [
["_unitCount", 0, [0]]
];
if (_opforcount >= (0.5 * GRLIB_sector_cap)) then {
if (_opforcount <= GRLIB_sector_cap) then {
_corrected_sector_size = GRLIB_sector_size - (GRLIB_sector_size * 0.5 * ((_opforcount / GRLIB_sector_cap) - 0.5));
} else {
_corrected_sector_size = GRLIB_sector_size * 0.75;
};
};
_corrected_sector_size
if (_unitCount < (GRLIB_sector_cap / 2)) exitWith {GRLIB_sector_size};
if (_unitCount <= GRLIB_sector_cap) exitWith {GRLIB_sector_size - (GRLIB_sector_size * 0.5 * ((_unitCount / GRLIB_sector_cap) - 0.5))};
GRLIB_sector_size * 0.75