aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfvnkhead <98965760+fvnkhead@users.noreply.github.com>2023-09-02 19:50:28 +0300
committerGitHub <noreply@github.com>2023-09-02 18:50:28 +0200
commitc7e50b28fe31e20b064f812758d8a0f5e889ea74 (patch)
treea321fda5afb3c6f08603d0b720f4c088282af859
parentf16af287534fceeb466bbd474d1ab3d94c19d1a3 (diff)
downloadNorthstarMods-c7e50b28fe31e20b064f812758d8a0f5e889ea74.tar.gz
NorthstarMods-c7e50b28fe31e20b064f812758d8a0f5e889ea74.zip
Prefer not to spawn within 20 meters of enemy (#512)v1.18.3-rc1v1.18.3v1.18.2-rc1v1.18.2
It indeed can't hurt Co-authored-by: uniboi <64006268+uniboi@users.noreply.github.com>
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut9
1 files changed, 6 insertions, 3 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
index 5bf150c0..4956375b 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
@@ -261,9 +261,12 @@ bool function IsSpawnpointValid( entity spawnpoint, int team )
return false
}
- array<entity> projectiles = GetProjectileArrayEx( "any", TEAM_ANY, TEAM_ANY, spawnpoint.GetOrigin(), 600 )
- foreach ( entity projectile in projectiles )
- if ( projectile.GetTeam() != team )
+ const minEnemyDist = 1000.0 // about 20 meters?
+ // in rsquirrel extend returns null unlike in vanilla squirrel
+ array< entity > spawnBlockers = GetPlayerArrayEx( "any", TEAM_ANY, TEAM_ANY, spawnpoint.GetOrigin(), minEnemyDist )
+ spawnBlockers.extend( GetProjectileArrayEx( "any", TEAM_ANY, TEAM_ANY, spawnpoint.GetOrigin(), minEnemyDist ) )
+ foreach ( entity blocker in spawnBlockers )
+ if ( blocker.GetTeam() != team )
return false
// los check