aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-10 00:04:27 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-10 00:04:27 +0000
commitb3f0e4598c5c573b0e79a8a9307966d2c07f5e4a (patch)
tree5f63d17ad800babda8686b143c1a1cb4bfd7ad1e /Northstar.CustomServers/mod/scripts/vscripts/mp
parent1f534d940670d6df826be68b39fcaa846f139a81 (diff)
downloadNorthstarMods-b3f0e4598c5c573b0e79a8a9307966d2c07f5e4a.tar.gz
NorthstarMods-b3f0e4598c5c573b0e79a8a9307966d2c07f5e4a.zip
potentially fix bug with roundwinningkillreplays
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