diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 9fb8d5bf7018..72950b17f47f 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -646,9 +646,9 @@ return var/virt_z = virtual_z() - if(!virt_z) - return - var/players_on_virtual_z = LAZYACCESS(SSmobs.players_by_virtual_z, "[virt_z]") + var/players_on_virtual_z = 0 + if(virt_z) + players_on_virtual_z = LAZYACCESS(SSmobs.players_by_virtual_z, "[virt_z]") if(!length(players_on_virtual_z)) toggle_ai(AI_Z_OFF) else if(AIStatus == AI_Z_OFF)