|
416 | 416 | { |
417 | 417 | _counter = 0; |
418 | 418 |
|
419 | | - // only count one spawner per vehicle |
420 | | - _occupants = units Occupants select { _x getVariable ["spawner", false] and _x == effectiveCommander vehicle _x }; |
421 | | - _invaders = units Invaders select { _x getVariable ["spawner", false] and _x == effectiveCommander vehicle _x }; |
| 419 | + // Only count one spawner per vehicle. SimpleVM is much faster with split selects |
| 420 | + _occupants = units Occupants select { _x getVariable ["spawner", false] } select { _x == effectiveCommander vehicle _x }; |
| 421 | + _invaders = units Invaders select { _x getVariable ["spawner", false] } select { _x == effectiveCommander vehicle _x }; |
422 | 422 |
|
| 423 | + // No effective-commander optimization for players because it breaks on disconnection |
| 424 | + _teamplayer = units teamPlayer select { _x getVariable ["spawner", false] }; |
423 | 425 | // Exclude players in fast-moving fixed-wing aircraft |
424 | | - _teamplayer = units teamPlayer select { |
| 426 | + _teamplayer = _teamplayer select { |
425 | 427 | private _veh = vehicle _x; |
426 | | - _x getVariable ["spawner", false] and _x == effectiveCommander _veh |
427 | | - and (_veh == _x or {!(_veh isKindOf "Plane" and (!isTouchingGround _veh or speed _veh > 80))}) |
| 428 | + !(_veh isKindOf "Plane") or {isTouchingGround _veh or speed _veh < 80} |
428 | 429 | }; |
429 | 430 | // Add in rebel-controlled UAVs |
430 | 431 | _teamplayer append (allUnitsUAV select { side group _x == teamPlayer }); |
|
434 | 435 | { |
435 | 436 | private _rp = _x getVariable ["owner", _x]; // real player unit in remote-control case |
436 | 437 | private _veh = vehicle _rp; |
437 | | - if (_rp != effectiveCommander _veh) then { continue }; |
438 | | - if (_veh == _rp or {!(_veh isKindOf "Air" and speed _veh > 50)}) then { _players pushBack _rp }; |
| 438 | + if (!(_veh isKindOf "Air") or { speed _veh < 50 }) then { _players pushBack _rp }; |
439 | 439 | } forEach (allPlayers - entities "HeadlessClient_F"); |
440 | 440 | }; |
441 | 441 |
|
|
0 commit comments