Skip to content

Commit

Permalink
Fix color delay
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Feb 3, 2024
1 parent 4a11976 commit 5090e33
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mod/Jailbreak.Rebel/RebelManager.cs
Original file line number Diff line number Diff line change
@@ -111,16 +111,17 @@ private void ApplyRebelColor(CCSPlayerController player)
{
if (!player.IsValid || player.Pawn.Value == null)
return;
var percentRGB = 255 - (int)Math.Round(GetRebelTimePercentage(player) * 255.0);
var percent = GetRebelTimePercentage(player);
var percentRGB = 255 - (int)Math.Round(percent * 255.0);
var color = Color.FromArgb(254, 255, percentRGB, percentRGB);
if (percentRGB <= 0)
if (percent <= 0)
{
color = Color.FromArgb(254, 255, 255, 255);
}

player.PrintToConsole("Color: " + color);
player.Pawn.Value.RenderMode = RenderMode_t.kRenderTransColor;
player.Pawn.Value.Render = color;
Utilities.SetStateChanged(player.Pawn.Value, "CBaseModelEntity", "m_clRender");
Utilities.SetStateChanged(player.Pawn.Value, "CBaseModelEntity", "m_clrRender");
}
}

0 comments on commit 5090e33

Please sign in to comment.