Fixed a bunch of the runtime errors cropping up in the server logs.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@175 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
n3ophyt3@gmail.com
2010-09-26 01:55:42 +00:00
parent 6cb50d4184
commit 26bc2276f4
20 changed files with 90 additions and 70 deletions

View File

@@ -569,7 +569,8 @@ datum
if(istype(O,/obj/decal/cleanable))
del(O)
else
O.clean_blood()
if (O)
O.clean_blood()
reaction_turf(var/turf/T, var/volume)
T.overlays = null
T.clean_blood()

View File

@@ -250,6 +250,7 @@
O.show_message(text("\red [] was hit by the syringe!", M), 1)
del(D)
return
for(var/atom/A in D.loc)
if(A == user) continue

View File

@@ -442,9 +442,9 @@
relaymove(mob/user as mob)
if (user.stat)
return
for (var/mob/M in hearers(src.loc.loc))
M << "<FONT size=[max(0, 5 - get_dist(src, M))]>CLONG, clong!</FONT>"
if (src.loc)
for (var/mob/M in hearers(src.loc.loc))
M << "<FONT size=[max(0, 5 - get_dist(src, M))]>CLONG, clong!</FONT>"
playsound(src.loc, 'clang.ogg', 50, 0, 0)

View File

@@ -867,13 +867,14 @@
var/newblock
var/tstructure2
var/oldblock
block = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),src.subblock,1)
src.delete = 1
src.temphtml = text("Working ... Please wait ([] Seconds)", src.radduration)
usr << browse(temphtml, "window=scannernew;size=550x650")
onclose(usr, "scannernew")
sleep(10*src.radduration)
if (!src.connected.occupant)
if (src.connected.occupant)
block = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),src.subblock,1)
src.delete = 1
src.temphtml = text("Working ... Please wait ([] Seconds)", src.radduration)
usr << browse(temphtml, "window=scannernew;size=550x650")
onclose(usr, "scannernew")
sleep(10*src.radduration)
else
temphtml = null
delete = 0
return null

View File

@@ -13,6 +13,7 @@
pressure_resistance = 7*ONE_ATMOSPHERE
var/temperature_resistance = 1000 + T0C
volume = 1000
var/throwforce = 0
/obj/machinery/portable_atmospherics/canister/sleeping_agent
name = "Canister: \[N2O\]"

View File

@@ -44,11 +44,12 @@
else if (O.g_amt || O.m_amt)
spawn(16) {
flick("autolathe_c",src)
if(O.g_amt) // Added null checks to avoid runtime errors when an item doesn't have an expected variable -- TLE
src.g_amount += O.g_amt
if(O.m_amt)
src.m_amount += O.m_amt
del O
if(O)
if(O.g_amt) // Added null checks to avoid runtime errors when an item doesn't have an expected variable -- TLE
src.g_amount += O.g_amt
if(O.m_amt)
src.m_amount += O.m_amt
del O
}
else
user << "This object does not contain significant amounts of metal or glass, or cannot be accepted by the autolathe due to size or hazardous materials."

View File

@@ -8,6 +8,7 @@
var/datum/ai_laws/laws = new /datum/ai_laws/asimov
var/obj/item/weapon/circuitboard/circuit = null
var/obj/item/brain/brain = null
var/throwforce = 0
/obj/AIcore/attackby(obj/item/weapon/P as obj, mob/user as mob)
@@ -83,11 +84,12 @@
if(P:amount >= 2)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
if(do_after(user, 20))
P:amount -= 2
if(!P:amount) del(P)
user << "\blue You put in the glass panel."
src.state = 4
src.icon_state = "4"
if (P)
P:amount -= 2
if(!P:amount) del(P)
user << "\blue You put in the glass panel."
src.state = 4
src.icon_state = "4"
if(istype(P, /obj/item/weapon/aiModule/asimov))
src.laws.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")

View File

@@ -169,11 +169,12 @@
if(P:amount >= 2)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
if(do_after(user, 20))
P:amount -= 2
if(!P:amount) del(P)
user << "\blue You put in the glass panel."
src.state = 4
src.icon_state = "4"
if(P)
P:amount -= 2
if(!P:amount) del(P)
user << "\blue You put in the glass panel."
src.state = 4
src.icon_state = "4"
if(4)
if(istype(P, /obj/item/weapon/crowbar))
playsound(src.loc, 'Crowbar.ogg', 50, 1)

View File

@@ -162,7 +162,8 @@
if(R)
var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort")
if(choice == "Confirm")
R.self_destruct()
if(R)
R.self_destruct()
src.add_fingerprint(usr)
src.updateUsrDialog()

View File

@@ -13,18 +13,19 @@
if (src.metal_amount < 150000.0)
var/count = 0
spawn(15)
if(!O:amount)
return
while(metal_amount < 150000 && O:amount)
src.metal_amount += O:height * O:width * O:length * 100000.0
O:amount--
count++
if(O)
if(!O:amount)
return
while(metal_amount < 150000 && O:amount)
src.metal_amount += O:height * O:width * O:length * 100000.0
O:amount--
count++
if (O:amount < 1)
del(O)
if (O:amount < 1)
del(O)
user << "You insert [count] metal sheet\s into the fabricator."
updateDialog()
user << "You insert [count] metal sheet\s into the fabricator."
updateDialog()
else
user << "The robot part maker is full. Please remove metal from the robot part maker in order to insert more."

View File

@@ -660,7 +660,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
var/obj/item/weapon/book/b = new(src.loc)
b.dat = O:info
b.name = "Print Job #" + "[rand(100, 999)]"
b.icon_state = "book" + rand(1,7)
b.icon_state = "book[rand(1,7)]"
del(O)
else
..()

View File

@@ -219,8 +219,9 @@
return safe.attackby(W, user)
if ((!( shielded ) || !( W.flags ) & 32))
spawn( 0 )
W.attack(src, user)
return
if (W)
W.attack(src, user)
return
return

View File

@@ -128,8 +128,9 @@
O.invisibility = 0
O.name = "Cyborg"
O.real_name = "Cyborg"
O.lastKnownIP = src.brain.owner.client.address
if (src.brain.owner.client)
O.lastKnownIP = src.brain.owner.client.address
src.brain.owner.client.mob = O
else
for(var/mob/dead/observer/G in world)

View File

@@ -130,7 +130,8 @@
user.show_message("\blue The timer is now secured!", 1)
else
user.show_message("\blue The timer is now unsecured!", 1)
src.part2.status = src.status
if (src.part2)
src.part2.status = src.status
src.add_fingerprint(user)
return

View File

@@ -605,10 +605,11 @@ turf/simulated/floor/proc/update_icon()
if (C:amount >= 2)
user << "\blue Reinforcing the floor..."
if(do_after(user, 30))
ReplaceWithEngineFloor()
C:amount -= 2
if (C:amount <= 0) del(C) //wtf
playsound(src.loc, 'Deconstruct.ogg', 80, 1)
if (C)
ReplaceWithEngineFloor()
C:amount -= 2
if (C:amount <= 0) del(C) //wtf
playsound(src.loc, 'Deconstruct.ogg', 80, 1)
else
user << "\red You need more rods."
else

View File

@@ -168,9 +168,10 @@
break
if(clear)
L+=T
usr.loc = pick(L)
if (L.len)
usr.loc = pick(L)
else
usr << "Teleporting to that area doesn't seem to be working currently. But at least now it tells you that."
var/list/karma_spenders = list()

View File

@@ -1004,15 +1004,16 @@
if (istype(src.wear_suit, /obj/item/clothing/suit))
var/t1 = src.wear_suit.icon_state
src.overlays += image("icon" = 'suit.dmi', "icon_state" = text("[][]", t1, (!( src.lying ) ? null : "2")), "layer" = MOB_LAYER)
if (src.wear_suit.blood_DNA)
var/icon/stain_icon = null
if (istype(src.wear_suit, /obj/item/clothing/suit/armor/vest || /obj/item/clothing/suit/wcoat || /obj/item/clothing/suit/armor/a_i_a_ptank))
stain_icon = icon('blood.dmi', "armorblood[!src.lying ? "" : "2"]")
else if (istype(src.wear_suit, /obj/item/clothing/suit/det_suit || /obj/item/clothing/suit/labcoat))
stain_icon = icon('blood.dmi', "coatblood[!src.lying ? "" : "2"]")
else
stain_icon = icon('blood.dmi', "suitblood[!src.lying ? "" : "2"]")
src.overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
if (src.wear_suit)
if (src.wear_suit.blood_DNA)
var/icon/stain_icon = null
if (istype(src.wear_suit, /obj/item/clothing/suit/armor/vest || /obj/item/clothing/suit/wcoat || /obj/item/clothing/suit/armor/a_i_a_ptank))
stain_icon = icon('blood.dmi', "armorblood[!src.lying ? "" : "2"]")
else if (istype(src.wear_suit, /obj/item/clothing/suit/det_suit || /obj/item/clothing/suit/labcoat))
stain_icon = icon('blood.dmi', "coatblood[!src.lying ? "" : "2"]")
else
stain_icon = icon('blood.dmi', "suitblood[!src.lying ? "" : "2"]")
src.overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
src.wear_suit.screen_loc = ui_oclothing
if (istype(src.wear_suit, /obj/item/clothing/suit/straight_jacket))
if (src.handcuffed)

View File

@@ -4,8 +4,9 @@
spawn( 0 )
O.mode = 0
if(!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.client)
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
src.verbs += /mob/proc/ghostize
return

View File

@@ -1403,11 +1403,12 @@
M << "\red Admin PM from-<b>[key_name(usr, M, 0)]</b>: [t]"
usr << "\blue Admin PM to-<b>[key_name(M, usr, 1)]</b>: [t]"
else
if (M.client && M.client.holder)
M << "\blue Reply PM from-<b>[key_name(usr, M, 1)]</b>: [t]"
else
M << "\red Reply PM from-<b>[key_name(usr, M, 0)]</b>: [t]"
usr << "\blue Reply PM to-<b>[key_name(M, usr, 0)]</b>: [t]"
if (M)
if (M.client && M.client.holder)
M << "\blue Reply PM from-<b>[key_name(usr, M, 1)]</b>: [t]"
else
M << "\red Reply PM from-<b>[key_name(usr, M, 0)]</b>: [t]"
usr << "\blue Reply PM to-<b>[key_name(M, usr, 0)]</b>: [t]"
log_admin("PM: [key_name(usr)]->[key_name(M)] : [t]")
@@ -1868,7 +1869,8 @@
newmob = new/mob/dead/observer(src)
src:client:mob = newmob
src.mind.transfer_to(newmob)
if (src.mind)
src.mind.transfer_to(newmob)
var/virus = src.virus
if (istype(src, /mob/living/silicon))

View File

@@ -11,10 +11,11 @@
/obj/machinery/power/solar/attackby(obj/item/weapon/W, mob/user)
..()
src.add_fingerprint(user)
src.health -= W.force
src.healthcheck()
return
if (W)
src.add_fingerprint(user)
src.health -= W.force
src.healthcheck()
return
/obj/machinery/power/solar/blob_act()
src.health--