diff --git a/code/modules/mob_spawn/mob_spawn.dm b/code/modules/mob_spawn/mob_spawn.dm index 37736ac08a2..1a7fbafcf11 100644 --- a/code/modules/mob_spawn/mob_spawn.dm +++ b/code/modules/mob_spawn/mob_spawn.dm @@ -36,6 +36,7 @@ if(faction) faction = string_list(faction) +/// Creates whatever mob the spawner makes. Return FALSE if we want to exit from here without doing that, returning NULL will be logged to admins. /obj/effect/mob_spawn/proc/create(mob/mob_possessor, newname) var/mob/living/spawned_mob = new mob_type(get_turf(src)) //living mobs only name_mob(spawned_mob, newname) @@ -194,9 +195,12 @@ user.log_message("became a [prompt_name].", LOG_GAME) uses -= 1 // Remove a use before trying to spawn to prevent strangeness like the spawner trying to spawn more mobs than it should be able to - if(!(create(user))) - message_admins("[src] didn't return anything when creating a mob, this might be broken! The use of the spawner it would have taken has been refunded.") - uses += 1 // Oops! We messed up and somehow the mob didn't spawn, but that's alright we can refund the use. + var/created = create(user) + if(!created) + if(isnull(created)) // If we explicitly return FALSE instead of just not returning a mob, we don't want to spam the admins + CRASH("An instance of [type] didn't return anything when creating a mob, this might be broken!") + + uses += 1 // Refund use because we didn't actually spawn anything check_uses() // Now we check if the spawner should delete itself or not