Skip to content

Commit 1bfeccd

Browse files
authored
Fix ignoring the last entity and props starting from client indexes in l4d2_tank_props_glow (SirPlease#923)
* Fix tank props hook iteration and entity validation Fix tank props hook iteration and entity validation * Fix loop in last entity index
1 parent 500f40e commit 1bfeccd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

addons/sourcemod/scripting/l4d2_tank_props_glow.sp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ void HookTankProps()
438438
{
439439
int iEntCount = GetMaxEntities();
440440

441-
for (int i = MaxClients; i < iEntCount; i++) {
441+
for (int i = MaxClients+1; i <= iEntCount; i++) {
442442
if (IsTankProp(i)) {
443443
SDKHook(i, SDKHook_OnTakeDamagePost, PropDamaged);
444444
g_hTankProps.Push(i);
@@ -489,7 +489,7 @@ void PossibleTankPropCreated(int iEntity, const char[] sClassName)
489489

490490
void Hook_PropSpawned(int iEntity)
491491
{
492-
if (iEntity < MaxClients || !IsValidEntity(iEntity)) {
492+
if (iEntity <= MaxClients || !IsValidEntity(iEntity)) {
493493
return;
494494
}
495495

0 commit comments

Comments
 (0)