Skip to content

Commit

Permalink
bugfix: keynotfoundexception
Browse files Browse the repository at this point in the history
  • Loading branch information
derkalle4 committed Jan 8, 2025
1 parent 83485b1 commit 5cb4194
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/RollTheDice+DiceIncreaseSpeed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ private HookResult EventDiceIncreaseSpeedOnPlayerHurt(EventPlayerHurt @event, Ga
if (victim == null) return HookResult.Continue;
if (!_playersWithIncreasedSpeed.Contains(victim)) return HookResult.Continue;
if (victim == null || victim.PlayerPawn == null || !victim.PlayerPawn.IsValid || victim.PlayerPawn.Value == null || victim.LifeState != (byte)LifeState_t.LIFE_ALIVE) return HookResult.Continue;
var playerPawn = victim.PlayerPawn.Value!;
AddTimer(0f, () =>
{
if (playerPawn == null || !playerPawn.IsValid) return;
if (victim == null || !victim.IsValid
|| victim.PlayerPawn == null || !victim.PlayerPawn.IsValid) return;
CCSPlayerPawn playerPawn = victim.PlayerPawn.Value!;
// set player speed
playerPawn.VelocityModifier = _playersWithIncreasedSpeedValue[victim];
// set state changed
Expand Down

0 comments on commit 5cb4194

Please sign in to comment.