fix a crash

weird crash popped up
This commit is contained in:
LightCat 2023-05-19 16:12:50 +02:00 committed by GitHub
parent 33a382b033
commit 6919e967b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,8 @@ static InitRoutine minigun_check(
continue;
// Get the weapon
CachedEntity *weapon = ENTITY(HandleToIDX(hWeapons[i]));
if (CE_BAD(weapon))
continue;
// if weapon is what we are looking for, hook and move on
if (CE_VALID(weapon) && (weapon->m_iClassID() == CL_CLASS(CTFMinigun) || weapon->m_iClassID() == CL_CLASS(CTFFlameThrower)) && !minigun_hook.IsHooked(weapon->InternalEntity()))
{