diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2022-01-29 04:54:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-29 03:54:51 +0000 |
commit | 0fe24385ee36048b374eae3891581349a7158f39 (patch) | |
tree | a324ab55354c2546537f11e847a7436267010639 /Northstar.Custom/mod/scripts/vscripts/gamemodes | |
parent | e91e9bf83b67f6d7ee464c628a9a4b27c0ec6dba (diff) | |
download | NorthstarMods-0fe24385ee36048b374eae3891581349a7158f39.tar.gz NorthstarMods-0fe24385ee36048b374eae3891581349a7158f39.zip |
Revert "improve fastball respawn logic" (#171)
This reverts commit 050e707f4762b976791c0934b88779e038f70ade.
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/gamemodes')
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut index 6ef26dcf..5f03b7b4 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut @@ -239,8 +239,7 @@ entity function CreatePanel( vector origin, vector angles ) DispatchSpawn( panel ) panel.SetModel( $"models/communication/terminal_usable_imc_01.mdl" ) - panel.s.scriptedPanel <- true - SetControlPanelUseFunc( panel, FastballOnPanelHacked ) + panel.s.onPlayerFinishesUsing_func = FastballOnPanelHacked Highlight_SetNeutralHighlight( panel, "sp_enemy_pilot" ) @@ -248,10 +247,14 @@ entity function CreatePanel( vector origin, vector angles ) } // control panel code isn't very statically typed, pain -function FastballOnPanelHacked( panel, player ) +function FastballOnPanelHacked( panel, player, success ) { expect entity( panel ) expect entity( player ) + expect bool( success ) + + if ( !success ) + return print( panel + " was hacked by " + player ) PanelFlipsToPlayerTeamAndUsableByEnemies( panel, player ) @@ -260,15 +263,12 @@ function FastballOnPanelHacked( panel, player ) foreach ( entity otherPlayer in GetPlayerArray() ) Remote_CallFunction_NonReplay( otherPlayer, "ServerCallback_FastballPanelHacked", panel.GetEncodedEHandle(), panel.s.panelId, player.GetEncodedEHandle() ) - // calculate respawn pos rather than using respawning player's position - vector respawnPos = panel.GetOrigin() + panel.GetForwardVector() * 50.0 - // respawn dead players foreach ( entity deadPlayer in GetPlayerArrayOfTeam( player.GetTeam() ) ) { if ( !IsAlive( deadPlayer ) ) { - deadPlayer.SetOrigin( respawnPos ) + deadPlayer.SetOrigin( player.GetOrigin() ) deadPlayer.RespawnPlayer( null ) Remote_CallFunction_NonReplay( deadPlayer, "ServerCallback_FastballRespawnPlayer" ) } |