michail-nikolaev / task-force-arma-3-radio

TeamSpeak integration for Arma 3
http://radio.task-force.ru/en/
Other
313 stars 169 forks source link

allUnits is not guaranteed to include allPlayers #1078

Closed JakubNei closed 8 years ago

JakubNei commented 8 years ago

TFAR gets list of all units from allUnits. Positions of those units are then send to TS plugin. If unit position is not send to TS plugin, TS plugin thinks unit has disabled TFAR.

Problem: Sometimes your computer doesn't include some players in allUnits array. Result: You can hear some players that are ingame as if they had disabled TFAR.

Seems if there is alot of units, Arma 3 goes into some kind of optimization mode and stops sending info about units that are far away.

So if there are 400 units on server and 30 players. New player joins and spawns far away from me. This player will not be included in allUnits and TFAR will think this player has TFAR disabled, because it will not get info about his position. Thus this player will sound as if he had TFAR disabled.

Running this script seemed to fix it:

[{
    { player reveal _x } forEach allPlayers;
},"BIS_fnc_spawn",true] call BIS_fnc_MP;

Seems to recur after player (re)connects. Seems to recur after player respawns. Possibly related to Killzone Kid's comment at https://community.bistudio.com/wiki/reveal

Can be fixed by enabling serious mode.

Nonetheless code should be changed to cope with the fact that allUnits is not guaranteed to include allPlayers.

michail-nikolaev commented 8 years ago

Thanks for investigations