From bf2d74d80e8be323b8629eceb25dac1c0ac473e8 Mon Sep 17 00:00:00 2001 From: Twinmold93 Date: Sat, 11 Jun 2016 11:22:34 -0500 Subject: [PATCH] Spacepod Fix - Equipment Modules (#4637) * Spacepod Fix - Equipment Modules Changes the installed_module variable in equipment to a list, allowing the rest of the code to read it correctly. Now when equipment is added and removed from the pod, it updates properly. Also adds any equipment the pod starts with to the list. Fixes the issues in: https://github.com/ParadiseSS13/Paradise/issues/4599 * Changes List Call Changes: equipment_system.installed_modules = new/list() to equipment_system.installed_modules = list() * Properly Placement for List Defined Removes the definition of the variable as list() from spacepod.dm to equipment.dm, clearing up a little of size from the total code. * Removes shot_from Removes the shot_from lines from the code. --- code/modules/spacepods/equipment.dm | 2 +- code/modules/spacepods/spacepod.dm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/spacepods/equipment.dm b/code/modules/spacepods/equipment.dm index ead021dac06..07c49752d15 100644 --- a/code/modules/spacepods/equipment.dm +++ b/code/modules/spacepods/equipment.dm @@ -44,7 +44,7 @@ /datum/spacepod/equipment var/obj/spacepod/my_atom - var/list/obj/item/device/spacepod_equipment/installed_modules // holds an easy to access list of installed modules + var/list/obj/item/device/spacepod_equipment/installed_modules = list() // holds an easy to access list of installed modules var/obj/item/device/spacepod_equipment/weaponry/weapon_system // weapons system var/obj/item/device/spacepod_equipment/misc/misc_system // misc system diff --git a/code/modules/spacepods/spacepod.dm b/code/modules/spacepods/spacepod.dm index 4d6393b3348..2156977d6fe 100644 --- a/code/modules/spacepods/spacepod.dm +++ b/code/modules/spacepods/spacepod.dm @@ -73,6 +73,7 @@ pr_int_temp_processor = new /datum/global_iterator/pod_preserve_temp(list(src)) pr_give_air = new /datum/global_iterator/pod_tank_give_air(list(src)) equipment_system = new(src) + equipment_system.installed_modules += battery spacepods_list += src cargo_hold = new/obj/item/weapon/storage/internal(src) cargo_hold.w_class = 5 //so you can put bags in @@ -491,21 +492,25 @@ obj/spacepod/proc/add_equipment(mob/user, var/obj/item/device/spacepod_equipment T.loc = equipment_system equipment_system.weapon_system = T equipment_system.weapon_system.my_atom = src + equipment_system.installed_modules += T var/obj/item/device/spacepod_equipment/misc/tracker/L = new /obj/item/device/spacepod_equipment/misc/tracker L.loc = equipment_system equipment_system.misc_system = L equipment_system.misc_system.my_atom = src equipment_system.misc_system.enabled = 1 + equipment_system.installed_modules += L var/obj/item/device/spacepod_equipment/sec_cargo/chair/C = new /obj/item/device/spacepod_equipment/sec_cargo/chair C.loc = equipment_system equipment_system.sec_cargo_system = C equipment_system.sec_cargo_system.my_atom = src + equipment_system.installed_modules += C max_passengers = 1 var/obj/item/device/spacepod_equipment/lock/keyed/K = new /obj/item/device/spacepod_equipment/lock/keyed K.loc = equipment_system equipment_system.lock_system = K equipment_system.lock_system.my_atom = src equipment_system.lock_system.id = 100000 + equipment_system.installed_modules += K /obj/spacepod/random/New() ..()