fn_getSectorRange
This commit is contained in:
parent
8e2ac32de9
commit
0407c62377
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue