mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #1164 from acemod/litterFixes
Litter distribution fix and "floating litter over water" fix (medical)
This commit is contained in:
commit
d42d0ef69d
@ -38,12 +38,18 @@ _litter = getArray (_config >> "litter");
|
|||||||
|
|
||||||
_createLitter = {
|
_createLitter = {
|
||||||
private["_position", "_litterClass", "_direction"];
|
private["_position", "_litterClass", "_direction"];
|
||||||
_position = getPos (_this select 0);
|
|
||||||
|
// @TODO: handle carriers over water
|
||||||
|
// For now, don't spawn litter if we are over water to avoid floating litter
|
||||||
|
if(surfaceIsWater (getPos (_this select 0))) exitWith { false };
|
||||||
|
|
||||||
|
_position = getPosATL (_this select 0);
|
||||||
|
_position = [_position select 0, _position select 1, 0];
|
||||||
_litterClass = _this select 1;
|
_litterClass = _this select 1;
|
||||||
if (random(1) >= 0.5) then {
|
if (random(1) >= 0.5) then {
|
||||||
_position = [(_position select 0) + random 2, (_position select 1) + random 2, _position select 2];
|
_position = [(_position select 0) + random 1, (_position select 1) + random 1, _position select 2];
|
||||||
} else {
|
} else {
|
||||||
_position = [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2];
|
_position = [(_position select 0) - random 1, (_position select 1) - random 1, _position select 2];
|
||||||
};
|
};
|
||||||
_direction = (random 360);
|
_direction = (random 360);
|
||||||
|
|
||||||
|
@ -14,7 +14,10 @@ if (isNil QGVAR(allCreatedLitter)) then {
|
|||||||
|
|
||||||
_litterObject = _litterClass createVehicleLocal _position;
|
_litterObject = _litterClass createVehicleLocal _position;
|
||||||
_litterObject setDir _direction;
|
_litterObject setDir _direction;
|
||||||
|
_litterObject setPosATL _position;
|
||||||
|
// Move the litter next frame to get rid of HORRIBLE spacing, fixes #1112
|
||||||
|
[{ (_this select 0) setPosATL (_this select 1); }, [_litterObject, _position]] call EFUNC(common,execNextFrame);
|
||||||
|
|
||||||
_maxLitterCount = getArray (configFile >> "ACE_Settings" >> QGVAR(litterSimulationDetail) >> "_values") select GVAR(litterSimulationDetail);
|
_maxLitterCount = getArray (configFile >> "ACE_Settings" >> QGVAR(litterSimulationDetail) >> "_values") select GVAR(litterSimulationDetail);
|
||||||
if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then {
|
if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then {
|
||||||
// gank the first litter object, and spawn ours.
|
// gank the first litter object, and spawn ours.
|
||||||
|
Loading…
Reference in New Issue
Block a user