Skip to content

Commit

Permalink
Fixed client checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
NotnHeavy committed Feb 14, 2024
1 parent ade69de commit 3b72825
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripting/NotnHeavy - Sentry Point Laser.sp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Plugin myinfo =
name = PLUGIN_NAME,
author = "NotnHeavy",
description = "A random plugin that spawns a beam between a sentry and its target point.",
version = "1.2.1",
version = "1.2",
url = "none"
};

Expand Down Expand Up @@ -221,12 +221,12 @@ public void OnGameFrame()

// Check if there is an enemy target to hit.
int enemy = GetEntPropEnt(i, Prop_Send, "m_hEnemy");
if (IsValidEntity(enemy) && 1 <= enemy <= MaxClients)
if (IsValidEntity(enemy))
{
// Get an origin where the sentry is desiring to shoot at.
SDKCall(SDKCall_CObjectSentrygun_GetEnemyAimPosition, i, buffer, enemy);
TR_TraceRayFilter(origin, buffer, MASK_SOLID, RayType_EndPoint, Filter_IgnoreSentry, i);
if (!IsValidEntity(TR_GetEntityIndex()) || TR_GetEntityIndex() == 0)
if ((!IsValidEntity(TR_GetEntityIndex()) || TR_GetEntityIndex() == 0) && 1 <= enemy <= MaxClients)
{
GetClientEyePosition(enemy, buffer);
AddVectors(buffer, { 0.00, 0.00, -5.00 }, buffer);
Expand Down

0 comments on commit 3b72825

Please sign in to comment.