Fix for amb257 - get_user_origin mode 4 false positives.

Most should be filtered out.
This commit is contained in:
Steve Dudenhoeffer 2007-08-04 03:34:34 +00:00
parent 9e0f3f01a7
commit 226d188d19

View File

@ -211,9 +211,15 @@ void Client_CurWeapon(void* mValue)
case 2: case 2:
if (!mPlayer) return; if (!mPlayer) return;
if (!iState || (iId < 1 || iId >= MAX_WEAPONS)) break; if (!iState || (iId < 1 || iId >= MAX_WEAPONS)) break;
mPlayer->weapons[iId].clip = *(int*)mValue;
mPlayer->current = iId; 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;
} }
} }