mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
[MIRROR] Don't print a misleading message when not picking a spider. [MDB IGNORE] (#19429)
* Don't print a misleading message when not picking a spider. (#73483) ## About The Pull Request Fixes #73468 The admin message in `mob_spawn/ghost_role/attack_ghost` was warning admins any time a ghost role spawner did not create a mob, however clicking a spider egg opens a radial menu. Neglecting to choose one of the options (and closing the menu) does not return a mob, and was implying that some kind of error occurred when this is actually expected behaviour. Also as noted in the comments this probably needn't message admins in the first place, we now log it as a crash instead. ## Why It's Good For The Game We shouldn't print a log message in admin chat for expected behaviour. Logging changes will help diagnose if this was masking an _actual_ bug. ## Changelog 🆑 fix: Clicking a spider egg and then closing the radial menu won't print a message in admin channel informing admins that the egg didn't spawn anything. /🆑 * Don't print a misleading message when not picking a spider. --------- Co-authored-by: Jacquerel <hnevard@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user