diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnMime.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnMime.cpp index 261f0ed6f..a200a7136 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnMime.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnMime.cpp @@ -46,12 +46,12 @@ static void OnStart() TASK_COMBAT_PED(ped, playerPed, 0, 16); SET_PED_FIRING_PATTERN(ped, 0xC6EE6B4C); - - while (GET_CURRENT_PED_WEAPON_ENTITY_INDEX(ped, 0) == 0) // doing '!' doesn't work - WAIT(0); Entity weapon = GET_CURRENT_PED_WEAPON_ENTITY_INDEX(ped, 0); - SET_ENTITY_ALPHA(weapon, 0, false); + if (DOES_ENTITY_EXIST(weapon)) + { + SET_ENTITY_ALPHA(weapon, 0, false); + } } // clang-format off @@ -61,4 +61,4 @@ REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo .Id = "spawn_mime", .EffectGroupType = EEffectGroupType::SpawnEnemySpecial } -); \ No newline at end of file +);