aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-11 17:12:25 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-11 17:12:25 +0000
commit8cd6924c1112213442b755866a5b6811efae236c (patch)
tree6c04cf94d86e5f7977105f4e8e5a1d64282a44b0 /Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
parentb3f0e4598c5c573b0e79a8a9307966d2c07f5e4a (diff)
downloadNorthstarMods-8cd6924c1112213442b755866a5b6811efae236c.tar.gz
NorthstarMods-8cd6924c1112213442b755866a5b6811efae236c.zip
fixes from playtests
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut20
1 files changed, 14 insertions, 6 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
index 70d1e527..94138561 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/spawn.nut
@@ -7,6 +7,7 @@ global function SetRespawnsEnabled
global function RespawnsEnabled
global function SetSpawnpointGamemodeOverride
global function GetSpawnpointGamemodeOverride
+global function AddSpawnpointValidationRule
global function CreateNoSpawnArea
global function DeleteNoSpawnArea
@@ -27,6 +28,7 @@ struct NoSpawnArea
struct {
bool respawnsEnabled = true
string spawnpointGamemodeOverride
+ array< bool functionref( entity, int ) > customSpawnpointValidationRules
table<string, NoSpawnArea> noSpawnAreas
@@ -75,6 +77,11 @@ bool function RespawnsEnabled()
return file.respawnsEnabled
}
+void function AddSpawnpointValidationRule( bool functionref( entity spawn, int team ) rule )
+{
+ file.customSpawnpointValidationRules.append( rule )
+}
+
string function CreateNoSpawnArea( int blockSpecificTeam, int blockEnemiesOfTeam, vector position, float lifetime, float radius )
{
NoSpawnArea noSpawnArea
@@ -166,7 +173,7 @@ entity function FindSpawnPoint( entity player, bool isTitan, bool useStartSpawnp
}
entity spawnpoint = GetBestSpawnpoint( player, spawnpoints )
-
+
spawnpoint.s.lastUsedTime = Time()
player.SetLastSpawnPoint( spawnpoint )
@@ -230,21 +237,22 @@ bool function IsSpawnpointValid( entity spawnpoint, int team )
else if ( GameModeRemove( spawnpoint ) )
return false
}
-
- if ( Riff_FloorIsLava() && spawnpoint.GetOrigin().z < GetLethalFogTop() )
- return false
int compareTeam = spawnpoint.GetTeam()
if ( HasSwitchedSides() && ( compareTeam == TEAM_MILITIA || compareTeam == TEAM_IMC ) )
compareTeam = GetOtherTeam( compareTeam )
-
+
+ foreach ( bool functionref( entity, int ) customValidationRule in file.customSpawnpointValidationRules )
+ if ( !customValidationRule( spawnpoint, team ) )
+ return false
+
if ( spawnpoint.GetTeam() > 0 && compareTeam != team && !IsFFAGame() )
return false
if ( spawnpoint.IsOccupied() )
return false
- if ( Time() - spawnpoint.s.lastUsedTime <= 1.0 )
+ if ( Time() - spawnpoint.s.lastUsedTime <= 10.0 )
return false
foreach ( k, NoSpawnArea noSpawnArea in file.noSpawnAreas )