From d21758dc479c1c048ae8727366532ced8fab51bb Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sat, 8 Feb 2025 20:50:50 +1100 Subject: [PATCH 1/2] Fixing drones/robots/bots spawning meat when gibbed. --- code/modules/mob/living/bot/bot.dm | 3 +++ code/modules/mob/living/human/human.dm | 10 ++++++++++ code/modules/mob/living/silicon/silicon.dm | 2 ++ .../living/simple_animal/hostile/bad_drone.dm | 6 +++++- .../simple_animal/hostile/retaliate/drone.dm | 3 +++ code/modules/mob/mob.dm | 3 +++ code/modules/mob/mob_helpers.dm | 16 ---------------- 7 files changed, 26 insertions(+), 17 deletions(-) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 933e58b3afb..3676b16c400 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -38,6 +38,9 @@ layer = HIDING_MOB_LAYER +/mob/living/bot/isSynthetic() + return TRUE + /mob/living/bot/Initialize() . = ..() update_icon() diff --git a/code/modules/mob/living/human/human.dm b/code/modules/mob/living/human/human.dm index 5f1ec5dc359..4936094e5b0 100644 --- a/code/modules/mob/living/human/human.dm +++ b/code/modules/mob/living/human/human.dm @@ -1174,3 +1174,13 @@ /mob/living/human/get_attack_telegraph_delay() return client ? 0 : DEFAULT_ATTACK_COOLDOWN + +/mob/living/human/isSynthetic() + if(isnull(full_prosthetic)) + robolimb_count = 0 + var/list/limbs = get_external_organs() + for(var/obj/item/organ/external/E in limbs) + if(BP_IS_PROSTHETIC(E)) + robolimb_count++ + full_prosthetic = robolimb_count > 0 && (robolimb_count == LAZYLEN(limbs)) //If no organs, no way to tell + return full_prosthetic diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 7ad7fb9b96f..4eef94b0361 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -461,3 +461,5 @@ stance_damage = 0 return +/mob/living/silicon/isSynthetic() + return TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/bad_drone.dm b/code/modules/mob/living/simple_animal/hostile/bad_drone.dm index e87d75f9e44..c18ea28f698 100644 --- a/code/modules/mob/living/simple_animal/hostile/bad_drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/bad_drone.dm @@ -12,6 +12,7 @@ mob_size = MOB_SIZE_TINY gene_damage = -1 attack_delay = DEFAULT_QUICK_COOLDOWN + butchery_data = /decl/butchery_data/synthetic ai = /datum/mob_controller/aggressive/rogue_drone var/corpse = /obj/effect/decal/cleanable/blood/gibs/robot @@ -43,4 +44,7 @@ if(. && !gibbed) if(corpse) new corpse (loc) - qdel(src) \ No newline at end of file + qdel(src) + +/mob/living/simple_animal/hostile/rogue_drone/isSynthetic() + return TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm index 072c2951071..17f21fcf27a 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm @@ -258,6 +258,9 @@ C.origin_tech = @'{"[TECH_ESOTERIC]":[rand(3, 6)]}' return ..() +/mob/living/simple_animal/hostile/malf_drone/isSynthetic() + return TRUE + /obj/item/projectile/beam/drone damage = 15 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 854b125787f..bc565d7b019 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1488,3 +1488,6 @@ /mob/proc/has_magnetised_footing() var/obj/item/shoes = get_equipped_item(slot_shoes_str) return istype(shoes) && (shoes.item_flags & ITEM_FLAG_MAGNETISED) + +/mob/proc/isSynthetic() + return FALSE diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 5fb27df3f1d..727b1316081 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -8,22 +8,6 @@ /proc/mob_size_difference(var/mob_size_A, var/mob_size_B) return round(log(2, mob_size_A/mob_size_B), 1) -/mob/proc/isSynthetic() - return 0 - -/mob/living/human/isSynthetic() - if(isnull(full_prosthetic)) - robolimb_count = 0 - var/list/limbs = get_external_organs() - for(var/obj/item/organ/external/E in limbs) - if(BP_IS_PROSTHETIC(E)) - robolimb_count++ - full_prosthetic = robolimb_count > 0 && (robolimb_count == LAZYLEN(limbs)) //If no organs, no way to tell - return full_prosthetic - -/mob/living/silicon/isSynthetic() - return 1 - /mob/proc/isMonkey() return 0 From 0872878bbd38b1b566f482a2f605fe548c385bda Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sat, 8 Feb 2025 20:59:51 +1100 Subject: [PATCH 2/2] Cleans up bot card and access on Destroy()/gib() --- code/modules/mob/living/bot/bot.dm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 3676b16c400..75a92f0e057 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -15,6 +15,7 @@ var/light_strength = 3 var/busy = 0 + // Dummy object used to hold bot access strings. TODO: just put it on the mob. var/obj/access_scanner = null var/list/req_access = list() @@ -38,9 +39,6 @@ layer = HIDING_MOB_LAYER -/mob/living/bot/isSynthetic() - return TRUE - /mob/living/bot/Initialize() . = ..() update_icon() @@ -442,3 +440,17 @@ . = ..() if(istype(botcard) && !is_type_in_list(botcard, exceptions)) LAZYDISTINCTADD(., botcard) + +// We don't want to drop these on gib(). +/mob/living/bot/physically_destroyed(skip_qdel) + QDEL_NULL(botcard) + QDEL_NULL(access_scanner) + return ..() + +/mob/living/bot/Destroy() + QDEL_NULL(botcard) + QDEL_NULL(access_scanner) + return ..() + +/mob/living/bot/isSynthetic() + return TRUE