Skip to content

Commit

Permalink
lenient min/max config reading: take lowest val as min, highest as max (
Browse files Browse the repository at this point in the history
  • Loading branch information
Fusselwurm authored Oct 9, 2022
1 parent d72dea1 commit 3ae2634
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions addons/lifecycle/functions/fnc_findSpawnPosition.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ _this params [
["_mode", ""] /* optional: house | road */
];

assert(_minDistance <= _maxDistance);

private _halfSectorWidth = (_maxDistance - _minDistance) / 2;
private _initialSearchDir = random 360;

Expand Down
4 changes: 2 additions & 2 deletions addons/patrol/functions/fnc_addFootsy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ private _maxInitialGroupSize = GVAR(initialGroupSize);
private _groupSize = (floor random _maxInitialGroupSize) + 1;

private _footSpawnDistances = [GVAR(spawnDistancesOnFoot)] call EFUNC(common,parseCsv);
private _footSpawnDistanceMin = _footSpawnDistances#0;
private _footSpawnDistanceMax = _footSpawnDistances#1;
private _footSpawnDistanceMin = selectMin _footSpawnDistances;
private _footSpawnDistanceMax = selectMax _footSpawnDistances;

if (_forcePosition isNotEqualTo []) exitWith {
[_forcePosition, _groupSize, objNull, "patrol", []] call EFUNC(lifecycle,spawnCivilianGroup);
Expand Down
4 changes: 2 additions & 2 deletions addons/residents/functions/fnc_addResident.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ params [
private _house = if (_forcePosition isEqualTo []) then {

private _residentSpawnDistances = [GVAR(spawnDistancesResidents)] call EFUNC(common,parseCsv);
private _residentSpawnDistanceMin = _residentSpawnDistances#0;
private _residentSpawnDistanceMax = _residentSpawnDistances#1;
private _residentSpawnDistanceMin = selectMin _residentSpawnDistances;
private _residentSpawnDistanceMax = selectMax _residentSpawnDistances;

private _spawnPosition = [
_allPlayers,
Expand Down
4 changes: 2 additions & 2 deletions addons/voyage/functions/fnc_addCarCrew.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ params [
];

private _vehicleSpawnDistances = [GVAR(spawnDistancesInVehicles)] call EFUNC(common,parseCsv);
private _vehicleSpawnDistanceMin = _vehicleSpawnDistances#0;
private _vehicleSpawnDistanceMax = _vehicleSpawnDistances#1;
private _vehicleSpawnDistanceMin = selectMin _vehicleSpawnDistances;
private _vehicleSpawnDistanceMax = selectMax _vehicleSpawnDistances;

private _spawnPositionHouse = [
_allPlayers,
Expand Down

0 comments on commit 3ae2634

Please sign in to comment.