Fixes a runtime with building combat mechs (#25194)

* Fixes a runtime with building combat mechs

* Fixes it correctly this time
This commit is contained in:
Shadowlight213
2017-03-19 22:00:33 +01:00
committed by AnturK
parent e58f15638a
commit 4f145c2b6d
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -3,10 +3,10 @@
internal_damage_threshold = 50
armor = list(melee = 30, bullet = 30, laser = 15, energy = 20, bomb = 20, bio = 0, rad = 0, fire = 100, acid = 100)
/obj/mecha/combat/CheckParts(atom/holder)
/obj/mecha/combat/CheckParts(list/parts_list)
..()
var/obj/item/weapon/stock_parts/capacitor/C = locate() in holder
var/obj/item/weapon/stock_parts/scanning_module/SM = locate() in holder
var/obj/item/weapon/stock_parts/capacitor/C = locate() in contents
var/obj/item/weapon/stock_parts/scanning_module/SM = locate() in contents
step_energy_drain = 20 - (5 * SM.rating) //10 is normal, so on lowest part its worse, on second its ok and on higher its real good up to 0 on best
armor["energy"] += (C.rating * 10) //Each level of capacitor protects the mech against emp by 10%
qdel(C)
+3 -3
View File
@@ -562,7 +562,7 @@
/datum/construction/reversible/mecha/gygax/spawn_result()
var/obj/mecha/combat/gygax/M = new result(get_turf(holder))
M.CheckParts(holder)
M.CheckParts(holder.contents)
qdel(holder)
feedback_inc("mecha_gygax_created",1)
return
@@ -1147,7 +1147,7 @@
/datum/construction/reversible/mecha/durand/spawn_result()
var/obj/mecha/combat/gygax/M = new result(get_turf(holder))
M.CheckParts(holder)
M.CheckParts(holder.contents)
qdel(holder)
feedback_inc("mecha_durand_created",1)
return
@@ -1479,7 +1479,7 @@
/datum/construction/reversible/mecha/phazon/spawn_result()
var/obj/mecha/combat/gygax/M = new result(get_turf(holder))
M.CheckParts(holder)
M.CheckParts(holder.contents)
qdel(holder)
feedback_inc("mecha_phazon_created",1)
return