From 226d188d199fa95e41a553e51714d81ea443fa2f Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Sat, 4 Aug 2007 03:34:34 +0000 Subject: [PATCH] Fix for amb257 - get_user_origin mode 4 false positives. Most should be filtered out. --- amxmodx/emsg.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/amxmodx/emsg.cpp b/amxmodx/emsg.cpp index 62ded7c3..37de1b0f 100755 --- a/amxmodx/emsg.cpp +++ b/amxmodx/emsg.cpp @@ -211,9 +211,15 @@ void Client_CurWeapon(void* mValue) case 2: if (!mPlayer) return; if (!iState || (iId < 1 || iId >= MAX_WEAPONS)) break; - mPlayer->weapons[iId].clip = *(int*)mValue; mPlayer->current = iId; - mPlayer->lastHit = mPlayer->lastTrace; + + + if (*(int*)mValue < mPlayer->weapons[iId].clip && // Only update the lastHit vector if the clip size is decreasing + *(int*)mValue != -1) // But not if it's a melee weapon + { + mPlayer->lastHit = mPlayer->lastTrace; + } + mPlayer->weapons[iId].clip = *(int*)mValue; } }