aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut52
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut2
2 files changed, 11 insertions, 43 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
index fcad7d31..6673d174 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
@@ -218,6 +218,7 @@ void function CodeCallback_OnPlayerRespawned( entity player )
Remote_CallFunction_NonReplay( player, "ServerCallback_YouRespawned" )
player.s.respawnTime = Time()
+ player.SetPredictionEnabled( true )
Loadouts_TryGivePilotLoadout( player )
SetHumanRagdollImpactTable( player )
@@ -270,7 +271,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
if ( !IsValid( player ) )
return
- player.SetPredictionEnabled( true )
player.s.inPostDeath = false
})
@@ -294,26 +294,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
if ( shouldDoReplay )
thread TrackDestroyTimeForReplay( attacker, replayTracker )
- int damageSource = DamageInfo_GetDamageSourceIdentifier( damageInfo )
- //if ( damageSource == eDamageSourceId.fall )
- //{
- // // this is straight up just incorrect lol, based off tf1 stuff
- //
- // player.SetObserverModeStaticPosition( player.GetOrigin() )
- // player.SetObserverModeStaticAngles( player.GetVelocity() * -1 )
- //
- // player.StartObserverMode( OBS_MODE_STATIC_LOCKED )
- // player.SetObserverTarget( null )
- //}
- //else
- //{
- player.StartObserverMode( OBS_MODE_DEATHCAM )
- if ( ShouldSetObserverTarget( attacker ) )
- player.SetObserverTarget( attacker )
- else
- player.SetObserverTarget( null )
- //}
-
if ( !file.playerDeathsHidden )
Remote_CallFunction_NonReplay( player, "ServerCallback_YouDied", attacker.GetEncodedEHandle(), GetHealthFrac( attacker ), methodOfDeath )
@@ -330,10 +310,8 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
}
// quick note: in cases where player.Die() is called: e.g. for round ends, player == attacker
- if ( shouldDoReplay )
- {
- player.SetPredictionEnabled( false )
-
+ if ( shouldDoReplay && KillcamsEnabled() ) // hack: double check if killcams are enabled here in case gamestate has changed this
+ {
player.watchingKillreplayEndTime = Time() + replayLength
float beforeTime = GetKillReplayBeforeTime( player, methodOfDeath )
@@ -362,7 +340,6 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
player.WaitSignal( "RespawnMe" ) // set in base_gametype: ClientCommand_RespawnPlayer
- player.SetPredictionEnabled( true )
ClearRespawnAvailable( player ) // need so the respawn icon doesn't show for like a frame on next death
if ( ( expect bool( player.GetPersistentVar( "spawnAsTitan" ) ) && IsTitanAvailable( player ) ) || ( Riff_SpawnAsTitan() > 0 && Riff_ShouldSpawnAsTitan( player ) ) ) // spawn as titan
@@ -378,28 +355,19 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
void function PlayerWatchesKillReplayWrapper( entity player, entity attacker, float timeSinceAttackerSpawned, float timeOfDeath, float beforeTime, table replayTracker )
{
- PlayerWatchesKillReplay( player, attacker.GetEncodedEHandle(), attacker.GetIndexForEntity(), timeSinceAttackerSpawned, timeOfDeath, beforeTime, replayTracker )
- player.ClearReplayDelay()
- player.ClearViewEntity()
- player.SetPredictionEnabled( true )
-}
-
-void function EndReplayOnTime( entity player, float replayLength )
-{
player.EndSignal( "RespawnMe" )
player.EndSignal( "OnRespawned" )
+ player.EndSignal( "GameStateChanged" )
- wait replayLength
- if ( IsValid( player ) && KillcamsEnabled() )
- {
- print( "fucking how" )
-
+ OnThreadEnd( function() : ( player )
+ {
player.ClearReplayDelay()
player.ClearViewEntity()
player.SetPredictionEnabled( true )
-
- player.SetObserverTarget( null )
- }
+ })
+
+ player.SetPredictionEnabled( false )
+ PlayerWatchesKillReplay( player, attacker.GetEncodedEHandle(), attacker.GetIndexForEntity(), timeSinceAttackerSpawned, timeOfDeath, beforeTime, replayTracker )
}
void function DecideRespawnPlayer( entity player )
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index e3b252f7..46872692 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -39,7 +39,7 @@ struct {
bool roundWinningKillReplayTrackPilotKills = true
bool roundWinningKillReplayTrackTitanKills = false
-
+
float roundWinningKillReplayTime
entity roundWinningKillReplayVictim
entity roundWinningKillReplayAttacker