ArmaForces / SerialKillers

Arma 3 SerialKillers gamemode
Other
1 stars 0 forks source link

Server freezes on Tanoa due to Error in expression <_randomPos; #75

Open 3Mydlo3 opened 7 months ago

3Mydlo3 commented 7 months ago

Below is the log when this happens for the first time. Mission was started at around 20:35.

20:49:03 "[AFSK] [COMMON] [getNearestLocation] Pos: [12612.6,7872.71,0.00175858], Town: No location" 20:49:04 "[AFSK] [COMMON] [getNearestLocation] Pos: [7933.54,7662.53,0.00161171], Town: Location NameVillage at 7942, 7663" 20:49:04 "[AFSK] [COMMON] [getNearestLocation] Pos: [11440.7,12269.7,0.000900269], Town: Location NameVillage at 11418, 12360" 20:49:06 Error in expression <_randomPos; _randomPos = _randomPos findEmptyPosition [0, _emptyPosSearchRad> 20:49:06 Error position: <findEmptyPosition [0, _emptyPosSearchRad> 20:49:06 Error 0 elements provided, 3 expected 20:49:06 File /z/afsk/addons/civilian/functions/fnc_getCityRandomPos.sqf..., line 285 20:49:07 Error in expression <_randomPos; _randomPos = _randomPos findEmptyPosition [0, _emptyPosSearchRad> 20:49:07 Error position: <findEmptyPosition [0, _emptyPosSearchRad> 20:49:07 Error 0 elements provided, 3 expected 20:49:07 File /z/afsk/addons/civilian/functions/fnc_getCityRandomPos.sqf..., line 285

The code was not changed for 4 years and worked flawlessly on Chernarus and Malden. There is probably an issue with expecting a road in every village/city. On Tanoa, Sosovu (on a small island in western part of the map) doesn't have a meter of road. This causes infinite loop(s) which break the server.

3Mydlo3 commented 5 months ago

The issue appeared again in Bystrica #101 d513ab8, Nizhnoye doesn't have road there. Suggested workaround for now is to change location config so that it's ignored by the code:

class CfgWorlds
{
    class Woodland_ACR : CAWorld
    {
        class ACityC_Nizhnoye
        {
            type = "NameLocal";
        };
    };
};

I'll apply the same fix for Tanoa as well, especially that Sosovu is an island that no civilian could go to at this state anyway.