Skip to content

Commit 126bb92

Browse files
authored
Merge pull request NebulaSS13#4843 from MistakeNot4892/fix/gibbing
Fixing drones/robots/bots spawning meat/dropping IDs when gibbed.
2 parents 01696a2 + 0872878 commit 126bb92

File tree

7 files changed

+38
-17
lines changed

7 files changed

+38
-17
lines changed

code/modules/mob/living/bot/bot.dm

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
var/light_strength = 3
1616
var/busy = 0
1717

18+
// Dummy object used to hold bot access strings. TODO: just put it on the mob.
1819
var/obj/access_scanner = null
1920
var/list/req_access = list()
2021

@@ -439,3 +440,17 @@
439440
. = ..()
440441
if(istype(botcard) && !is_type_in_list(botcard, exceptions))
441442
LAZYDISTINCTADD(., botcard)
443+
444+
// We don't want to drop these on gib().
445+
/mob/living/bot/physically_destroyed(skip_qdel)
446+
QDEL_NULL(botcard)
447+
QDEL_NULL(access_scanner)
448+
return ..()
449+
450+
/mob/living/bot/Destroy()
451+
QDEL_NULL(botcard)
452+
QDEL_NULL(access_scanner)
453+
return ..()
454+
455+
/mob/living/bot/isSynthetic()
456+
return TRUE

code/modules/mob/living/human/human.dm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,3 +1174,13 @@
11741174

11751175
/mob/living/human/get_attack_telegraph_delay()
11761176
return client ? 0 : DEFAULT_ATTACK_COOLDOWN
1177+
1178+
/mob/living/human/isSynthetic()
1179+
if(isnull(full_prosthetic))
1180+
robolimb_count = 0
1181+
var/list/limbs = get_external_organs()
1182+
for(var/obj/item/organ/external/E in limbs)
1183+
if(BP_IS_PROSTHETIC(E))
1184+
robolimb_count++
1185+
full_prosthetic = robolimb_count > 0 && (robolimb_count == LAZYLEN(limbs)) //If no organs, no way to tell
1186+
return full_prosthetic

code/modules/mob/living/silicon/silicon.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,3 +461,5 @@
461461
stance_damage = 0
462462
return
463463

464+
/mob/living/silicon/isSynthetic()
465+
return TRUE

code/modules/mob/living/simple_animal/hostile/bad_drone.dm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
mob_size = MOB_SIZE_TINY
1313
gene_damage = -1
1414
attack_delay = DEFAULT_QUICK_COOLDOWN
15+
butchery_data = /decl/butchery_data/synthetic
1516
ai = /datum/mob_controller/aggressive/rogue_drone
1617
var/corpse = /obj/effect/decal/cleanable/blood/gibs/robot
1718

@@ -43,4 +44,7 @@
4344
if(. && !gibbed)
4445
if(corpse)
4546
new corpse (loc)
46-
qdel(src)
47+
qdel(src)
48+
49+
/mob/living/simple_animal/hostile/rogue_drone/isSynthetic()
50+
return TRUE

code/modules/mob/living/simple_animal/hostile/retaliate/drone.dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@
258258
C.origin_tech = @'{"[TECH_ESOTERIC]":[rand(3, 6)]}'
259259
return ..()
260260

261+
/mob/living/simple_animal/hostile/malf_drone/isSynthetic()
262+
return TRUE
263+
261264
/obj/item/projectile/beam/drone
262265
damage = 15
263266

code/modules/mob/mob.dm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,3 +1488,6 @@
14881488
/mob/proc/has_magnetised_footing()
14891489
var/obj/item/shoes = get_equipped_item(slot_shoes_str)
14901490
return istype(shoes) && (shoes.item_flags & ITEM_FLAG_MAGNETISED)
1491+
1492+
/mob/proc/isSynthetic()
1493+
return FALSE

code/modules/mob/mob_helpers.dm

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@
88
/proc/mob_size_difference(var/mob_size_A, var/mob_size_B)
99
return round(log(2, mob_size_A/mob_size_B), 1)
1010

11-
/mob/proc/isSynthetic()
12-
return 0
13-
14-
/mob/living/human/isSynthetic()
15-
if(isnull(full_prosthetic))
16-
robolimb_count = 0
17-
var/list/limbs = get_external_organs()
18-
for(var/obj/item/organ/external/E in limbs)
19-
if(BP_IS_PROSTHETIC(E))
20-
robolimb_count++
21-
full_prosthetic = robolimb_count > 0 && (robolimb_count == LAZYLEN(limbs)) //If no organs, no way to tell
22-
return full_prosthetic
23-
24-
/mob/living/silicon/isSynthetic()
25-
return 1
26-
2711
/mob/proc/isMonkey()
2812
return 0
2913

0 commit comments

Comments
 (0)