Skip to content

Commit

Permalink
Merge pull request #4843 from MistakeNot4892/fix/gibbing
Browse files Browse the repository at this point in the history
Fixing drones/robots/bots spawning meat/dropping IDs when gibbed.
  • Loading branch information
out-of-phaze authored Feb 12, 2025
2 parents 01696a2 + 0872878 commit 126bb92
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 17 deletions.
15 changes: 15 additions & 0 deletions code/modules/mob/living/bot/bot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -439,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
10 changes: 10 additions & 0 deletions code/modules/mob/living/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions code/modules/mob/living/silicon/silicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,5 @@
stance_damage = 0
return

/mob/living/silicon/isSynthetic()
return TRUE
6 changes: 5 additions & 1 deletion code/modules/mob/living/simple_animal/hostile/bad_drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -43,4 +44,7 @@
if(. && !gibbed)
if(corpse)
new corpse (loc)
qdel(src)
qdel(src)

/mob/living/simple_animal/hostile/rogue_drone/isSynthetic()
return TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 0 additions & 16 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 126bb92

Please sign in to comment.