mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
locality issue with fishing
This commit is contained in:
parent
cddf397a4b
commit
4d683e6055
@ -8,17 +8,28 @@ if (surfaceIsWater _currentPos) then {
|
||||
|
||||
if (_objects isEqualTo []) then{
|
||||
|
||||
_nearByBobbers = nearestObjects [position player,["Bobber_EPOCH"],12];
|
||||
if (_nearByBobbers isEqualTo []) then {
|
||||
_nearByBobbers = nearestObjects [player,["Bobber_EPOCH"],12];
|
||||
_nearByBobbersLocal = [];
|
||||
{
|
||||
if (local _x) then {
|
||||
_nearByBobbersLocal pushBack _x
|
||||
};
|
||||
} forEach _nearByBobbers;
|
||||
|
||||
if (_nearByBobbersLocal isEqualTo []) then {
|
||||
|
||||
// Cast
|
||||
_bobber = createVehicle ["Bobber_EPOCH",_currentPos, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
EPOCH_TEMPOBJ_PVS = [_bobber];
|
||||
publicVariableServer "EPOCH_TEMPOBJ_PVS"
|
||||
|
||||
_bobber setPosASL _currentPos;
|
||||
_bobber setVariable ["EPOCH_bobberTime", diag_tickTime];
|
||||
|
||||
} else {
|
||||
|
||||
_bobber = _nearByBobbers select 0;
|
||||
_bobber = _nearByBobbersLocal select 0;
|
||||
// Reel in and delete Bobber
|
||||
if !(isNull _bobber) then {
|
||||
|
||||
|
@ -451,10 +451,17 @@ while {alive player} do {
|
||||
if ((_tickTime - _EPOCH_30) > 30) then {
|
||||
_EPOCH_30 = _tickTime;
|
||||
|
||||
_nearByBobbersLocal = [];
|
||||
_nearByBobbers = player nearEntities[["Bobber_EPOCH"], 12];
|
||||
if !(_nearByBobbers isEqualTo []) then {
|
||||
{
|
||||
if (local _x) then {
|
||||
_nearByBobbersLocal pushBack _x
|
||||
}
|
||||
} forEach _nearByBobbers;
|
||||
|
||||
if !(_nearByBobbersLocal isEqualTo []) then {
|
||||
if ((random 100) < 50) then {
|
||||
_bobber = _nearByBobbers select floor(random(count _nearByBobbers));
|
||||
_bobber = _nearByBobbersLocal select floor(random(count _nearByBobbers));
|
||||
_bobber setVelocity [0,-1,-1];
|
||||
_bobber setVariable ["EPOCH_fishOnLine" , diag_tickTime];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user