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.
This commit is contained in:
Twinmold93
2016-06-11 11:22:34 -05:00
committed by Fox McCloud
parent 8724cebd32
commit bf2d74d80e
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -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
+5
View File
@@ -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()
..()