Skip to content

Commit

Permalink
add extra alive checking to lib function: fixes extra warden on last …
Browse files Browse the repository at this point in the history
…player death
  • Loading branch information
destoer committed Nov 30, 2023
1 parent a249118 commit 24543b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public static void test_laser(CCSPlayerController? invoke, CommandInfo command)

if(pawn != null && pawn.AbsOrigin != null)
{
//Vector end = new Vector(pawn.AbsOrigin.X + 100.0f,pawn.AbsOrigin.Y + 100.0f,pawn.AbsOrigin.Z + 100.0f);
Vector end = pawn.LookTargetPosition;
Vector end = new Vector(pawn.AbsOrigin.X + 100.0f,pawn.AbsOrigin.Y,pawn.AbsOrigin.Z + 100.0f);
//Vector end = pawn.LookTargetPosition;

if(invoke != null)
{
Expand Down
5 changes: 4 additions & 1 deletion src/Lib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static public bool is_ct(this CCSPlayerController? player)
// yes i know the null check is redundant but C# is dumb
static public bool is_valid_alive(this CCSPlayerController? player)
{
return player != null && player.is_valid() && player.PawnIsAlive;
return player != null && player.is_valid() && player.PawnIsAlive && player.get_health() > 0;
}

static public CCSPlayerPawn? pawn(this CCSPlayerController? player)
Expand Down Expand Up @@ -247,6 +247,9 @@ static public void draw_laser(Vector start, Vector end, float life, float width,
laser.Render = color;
laser.Width = 2.0f;

// circle not working?
//laser.Flags |= 8;

// set pos
laser.Teleport(start, ANGLE_ZERO, VEC_ZERO);

Expand Down

0 comments on commit 24543b8

Please sign in to comment.