From 3fc6d95cc87a5e41e43a89236ca7cb5889c2b544 Mon Sep 17 00:00:00 2001 From: "mport2004@gmail.com" Date: Sun, 14 Aug 2011 06:41:21 +0000 Subject: [PATCH] Fixed most of the runtimes from the latest server errorlog. Laser Cannon: After IRC talk cost went up by 2k diamonds and 1k glass Heavy version removed as it was more or less the same as the normal Cargo: cancelorder commented out as it is broken and throws runtimes. I don't really have the time or will to dig though the code and fix it right now. If anyone else or the guy who added it wants to fix it be my guest. runtime error: Cannot read "/datum/supply_order".object git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2009 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/disease.dm | 2 +- code/game/machinery/portable_turret.dm | 7 ---- code/game/objects/items/weapons/guns_new.dm | 36 ------------------- code/game/supplyshuttle.dm | 6 ++-- code/modules/chemical/Chemistry-Reagents.dm | 2 ++ .../modules/mob/living/silicon/robot/robot.dm | 24 ++++++------- code/modules/mob/new_player/preferences.dm | 11 +++--- code/modules/research/designs.dm | 11 +----- 8 files changed, 24 insertions(+), 75 deletions(-) diff --git a/code/datums/disease.dm b/code/datums/disease.dm index 977f0b605c..ba2fa63f4f 100644 --- a/code/datums/disease.dm +++ b/code/datums/disease.dm @@ -337,7 +337,7 @@ to null does not delete the object itself. Thank you. // world << "Setting res to [src]" var/saved_type = "[type]"//copy the value, not create the reference to it, so when the object is deleted, the value remains. affected_mob.resistances += text2path(saved_type) - if(istype(src, /datum/disease/alien_embryo))//Get rid of the flag. + if((affected_mob) && (istype(src, /datum/disease/alien_embryo)))//Get rid of the flag. affected_mob.alien_egg_flag = 0 // world << "Removing [src]" spawn(0) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 62471a68ee..dff5835d8c 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -522,13 +522,6 @@ Neutralize All Unidentified Life Signs: []
"}, if(!emagged) use_power(600) else use_power(1200) - else if(istype(E, /obj/item/weapon/gun/energy/heavylasercannon)) - A = new /obj/item/projectile/deathlaser( loc ) - A.original = target.loc - icon_state = "orange_target_prism" - if(!emagged) use_power(800) - else use_power(1600) - else if(istype(E, /obj/item/weapon/gun/energy/shockgun)) A = new /obj/item/projectile/fireball( loc ) A.original = target.loc diff --git a/code/game/objects/items/weapons/guns_new.dm b/code/game/objects/items/weapons/guns_new.dm index ec28415e43..2d6142e139 100644 --- a/code/game/objects/items/weapons/guns_new.dm +++ b/code/game/objects/items/weapons/guns_new.dm @@ -1111,42 +1111,6 @@ power_supply.give(power_supply.maxcharge) update_icon() - heavylasercannon - name = "heavy laser cannon" - desc = "A deathly heavy-duty laser cannon." - icon_state = "laser" - force = 20 - fire_sound = 'pulse.ogg' - origin_tech = "combat=4;materials=4;powerstorage=4" - load_into_chamber() - if(in_chamber) - return 1 - if(power_supply.charge < charge_cost) - return 0 - switch(mode) - if(0) - in_chamber = new /obj/item/projectile/heavylaser(src) - if(1) - in_chamber = new /obj/item/projectile/beam(src) - power_supply.use(charge_cost) - return 1 - - attack_self(mob/living/user as mob) - mode = !mode - switch(mode) - if(0) - user << "\red [src.name] is now set to heavy laser cannon." - fire_sound = 'pulse.ogg' - charge_cost = 150 - if(1) - user << "\red [src.name] is now set to laser." - fire_sound = 'Laser.ogg' - charge_cost = 50 - New() - power_supply = new /obj/item/weapon/cell(src) - power_supply.give(power_supply.maxcharge) - update_icon() - shockgun name = "shock gun" desc = "A high tech energy weapon that stuns and burns a target." diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index c3b0889d72..fc320fcd7e 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -483,9 +483,9 @@ var/ordernum=0 src.temp = "Current approved orders:

" for(var/S in supply_shuttle_shoppinglist) var/datum/supply_order/SO = S - src.temp += "[SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""] (Cancel)
" + src.temp += "[SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""]
"// (Cancel)
" src.temp += "
OK" - +/* else if (href_list["cancelorder"]) var/datum/supply_order/remove_supply = href_list["cancelorder"] supply_shuttle_shoppinglist -= remove_supply @@ -496,7 +496,7 @@ var/ordernum=0 var/datum/supply_order/SO = S src.temp += "[SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""] (Cancel)
" src.temp += "
OK" - +*/ else if (href_list["viewrequests"]) src.temp = "Current requests:

" for(var/S in supply_shuttle_requestlist) diff --git a/code/modules/chemical/Chemistry-Reagents.dm b/code/modules/chemical/Chemistry-Reagents.dm index 26b1cd8f77..38714f246a 100644 --- a/code/modules/chemical/Chemistry-Reagents.dm +++ b/code/modules/chemical/Chemistry-Reagents.dm @@ -634,6 +634,8 @@ datum ..() return reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume) + if(!istype(M, /mob/living)) + return //wooo more runtime fixin if(method == TOUCH) if(istype(M, /mob/living/carbon/human)) if(M:wear_mask) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 55ba7512e6..09ccd89f92 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -215,9 +215,10 @@ if(ticker.mode.name == "AI malfunction") var/datum/game_mode/malfunction/malf = ticker.mode for (var/datum/mind/malfai in malf.malf_ai) - if (connected_ai.mind == malfai) - if (malf.apcs >= 3) - stat(null, "Time until station control secured: [max(malf.AI_win_timeleft/(malf.apcs/3), 0)] seconds") + if(connected_ai) + if(connected_ai.mind == malfai) + if(malf.apcs >= 3) + stat(null, "Time until station control secured: [max(malf.AI_win_timeleft/(malf.apcs/3), 0)] seconds") else if(ticker.mode:malf_mode_declared) stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]") @@ -226,9 +227,11 @@ else stat(null, text("No Cell Inserted!")) + /mob/living/silicon/robot/restrained() return 0 + /mob/living/silicon/robot/ex_act(severity) flick("flash", flash) @@ -260,6 +263,7 @@ fireloss = f_loss updatehealth() + /mob/living/silicon/robot/meteorhit(obj/O as obj) for(var/mob/M in viewers(src, null)) M.show_message(text("\red [src] has been hit by [O]"), 1) @@ -271,6 +275,7 @@ updatehealth() return + /mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj) if(!Proj.nodamage) bruteloss += Proj.damage updatehealth() @@ -278,7 +283,6 @@ return - /mob/living/silicon/robot/Bump(atom/movable/AM as mob|obj, yes) spawn( 0 ) if ((!( yes ) || now_pushing)) @@ -311,15 +315,8 @@ now_pushing = null return return -/* -/mob/living/silicon/robot/proc/firecheck(turf/T as turf) - if (T.firelevel < 900000.0) - return 0 - var/total = 0 - total += 0.25 - return total -*/ + /mob/living/silicon/robot/triggerAlarm(var/class, area/A, var/O, var/alarmsource) if (stat == 2) return 1 @@ -344,6 +341,7 @@ if (viewalerts) robot_alerts() return 1 + /mob/living/silicon/robot/cancelAlarm(var/class, area/A as area, obj/origin) var/list/L = alarms[class] var/cleared = 0 @@ -361,6 +359,7 @@ if (viewalerts) robot_alerts() return !cleared + /mob/living/silicon/robot/attackby(obj/item/weapon/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/weldingtool) && W:welding) if (W:remove_fuel(0)) @@ -374,7 +373,6 @@ user << "Need more welding fuel!" return - else if(istype(W, /obj/item/weapon/cable_coil) && wiresexposed) var/obj/item/weapon/cable_coil/coil = W fireloss -= 30 diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index 368fb9a757..fc7cd4fe71 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -394,11 +394,12 @@ datum/preferences dat += "Play admin midis: [midis == 1 ? "Yes" : "No"]
" dat += "Show chat bubbles: [bubbles == 1 ? "Yes" : "No"]
" - if(user.client.holder) - if(user.client.holder.rank) - if(user.client.holder.rank == "Game Master") - dat += "
OOC
" - dat += "Change colour
__
" + if(user.client) + if(user.client.holder) + if(user.client.holder.rank) + if(user.client.holder.rank == "Game Master") + dat += "
OOC
" + dat += "Change colour
__
" dat += "
Occupation Choices
" if (destructive.Find(occupation[1])) diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index b84f50aab1..382d62ee0b 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -1016,18 +1016,9 @@ datum id = "lasercannon" req_tech = list("combat" = 4, "materials" = 3, "powerstorage" = 3) build_type = PROTOLATHE - materials = list("$metal" = 10000) + materials = list("$metal" = 10000, "$glass" = 1000, "$diamond" = 2000) build_path = "/obj/item/weapon/gun/energy/lasercannon" - heavylasercannon - name = "Heavy Laser Cannon" - desc = "A heavy duty laser cannon." - id = "lasercannon" - req_tech = list("combat" = 5, "materials" = 5, "powerstorage" = 5) - build_type = PROTOLATHE - materials = list("$metal" = 10000) - build_path = "/obj/item/weapon/gun/energy/heavy lasercannon" - shockgun name = "Shock Gun" desc = "Your opponent has just lost THE GAME."