From a7c7e9e8ec5a38fba3bf03947f0ec208efa942f4 Mon Sep 17 00:00:00 2001 From: Leo Date: Wed, 24 Jan 2018 15:57:38 -0200 Subject: [PATCH] Merge pull request #34783 from Cyberboss/FixDumbness Cleans up duplicated code and GC issues --- .../mob/living/simple_animal/hostile/pirate.dm | 10 ++++------ .../mob/living/simple_animal/hostile/syndicate.dm | 15 +++++---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/pirate.dm b/code/modules/mob/living/simple_animal/hostile/pirate.dm index 40f09759f8..e1ccbee712 100644 --- a/code/modules/mob/living/simple_animal/hostile/pirate.dm +++ b/code/modules/mob/living/simple_animal/hostile/pirate.dm @@ -35,6 +35,10 @@ . = ..() sord = new(src) +/mob/living/simple_animal/hostile/pirate/Destroy() + QDEL_NULL(sord) + return ..() + /mob/living/simple_animal/hostile/pirate/ranged name = "Pirate Gunner" icon_state = "pirateranged" @@ -59,7 +63,6 @@ /mob/living/simple_animal/hostile/pirate/space/Initialize() . = ..() - sord = new(src) set_light(3) /mob/living/simple_animal/hostile/pirate/space/ranged @@ -74,8 +77,3 @@ projectiletype = /obj/item/projectile/beam/laser loot = list(/obj/effect/mob_spawn/human/corpse/pirate/ranged, /obj/item/gun/energy/laser) - -/mob/living/simple_animal/hostile/pirate/space/ranged/Initialize() - . = ..() - set_light(3) - diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/syndicate.dm index 09f7152a10..1058794764 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate.dm @@ -45,7 +45,6 @@ check_friendly_fire = 1 status_flags = CANPUSH del_on_death = 1 - var/obj/effect/light_emitter/red_energy_sword/sord ///////////////Sword and shield//////////// @@ -86,12 +85,17 @@ name = "Syndicate Commando" loot = list(/obj/effect/gibspawner/human) speed = 1 + var/obj/effect/light_emitter/red_energy_sword/sord /mob/living/simple_animal/hostile/syndicate/melee/space/Initialize() . = ..() sord = new(src) set_light(4) +/mob/living/simple_animal/hostile/syndicate/melee/space/Destroy() + QDEL_NULL(sord) + return ..() + /mob/living/simple_animal/hostile/syndicate/melee/space/stormtrooper icon_state = "syndicatemeleestormtrooper" icon_living = "syndicatemeleestormtrooper" @@ -100,11 +104,6 @@ health = 340 loot = list(/obj/effect/gibspawner/human) -/mob/living/simple_animal/hostile/syndicate/melee/space/stormtrooper/Initialize() - . = ..() - sord = new(src) - set_light(4) - ///////////////Guns//////////// /mob/living/simple_animal/hostile/syndicate/ranged @@ -142,10 +141,6 @@ casingtype = /obj/item/ammo_casing/shotgun/buckshot loot = list(/obj/effect/gibspawner/human) -/mob/living/simple_animal/hostile/syndicate/ranged/space/stormtrooper/Initialize() - . = ..() - set_light(4) - ///////////////Misc//////////// /mob/living/simple_animal/hostile/syndicate/civilian