More runtime errors squashed.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@231 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
n3ophyt3@gmail.com
2010-09-30 18:30:49 +00:00
parent cf07db9502
commit 81b0fdea10
21 changed files with 148 additions and 122 deletions

View File

@@ -48,8 +48,10 @@ obj/machinery/atmospherics/valve
if(open) if(open)
if(reference == node1) if(reference == node1)
if(node2)
return node2.network_expand(new_network, src) return node2.network_expand(new_network, src)
else if(reference == node2) else if(reference == node2)
if(node1)
return node1.network_expand(new_network, src) return node1.network_expand(new_network, src)
return null return null

View File

@@ -120,6 +120,7 @@ datum
reagent_state = LIQUID reagent_state = LIQUID
reaction_turf(var/turf/T, var/volume) reaction_turf(var/turf/T, var/volume)
if (!istype(T, /turf/space))
src = null src = null
if(T:wet >= 2) return if(T:wet >= 2) return
T:wet = 2 T:wet = 2

View File

@@ -830,6 +830,7 @@
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
if (href_list["rejuv"]) if (href_list["rejuv"])
var/mob/living/carbon/human/H = src.connected.occupant var/mob/living/carbon/human/H = src.connected.occupant
if(H)
if (H.reagents.get_reagent_amount("inaprovaline") < 60) if (H.reagents.get_reagent_amount("inaprovaline") < 60)
H.reagents.add_reagent("inaprovaline", 30) H.reagents.add_reagent("inaprovaline", 30)
usr << text("Occupant now has [] units of rejuvenation in his/her bloodstream.", H.reagents.get_reagent_amount("inaprovaline")) usr << text("Occupant now has [] units of rejuvenation in his/her bloodstream.", H.reagents.get_reagent_amount("inaprovaline"))

View File

@@ -141,6 +141,7 @@
var/prob_right_dude = rand(prob_correct_person_lower, prob_correct_person_higher) var/prob_right_dude = rand(prob_correct_person_lower, prob_correct_person_higher)
var/prob_right_job = rand(prob_correct_job_lower, prob_correct_job_higher) var/prob_right_job = rand(prob_correct_job_lower, prob_correct_job_higher)
if(prob(prob_right_job)) if(prob(prob_right_job))
if(correct_mob)
changeling_job = correct_mob:assigned_role changeling_job = correct_mob:assigned_role
else else
var/list/job_tmp = get_all_jobs() var/list/job_tmp = get_all_jobs()

View File

@@ -132,6 +132,7 @@ datum
check_completion() check_completion()
if(steal_target) if(steal_target)
if(owner.current)
if(owner.current.check_contents_for(steal_target)) if(owner.current.check_contents_for(steal_target))
if(target_name == "functional ai") if(target_name == "functional ai")
// world << "dude's after an AI, time to check for one." // world << "dude's after an AI, time to check for one."

View File

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

View File

@@ -7,6 +7,7 @@
var/volume = 0 var/volume = 0
var/destroyed = 0 var/destroyed = 0
var/throwforce = 0
var/maximum_pressure = 90*ONE_ATMOSPHERE var/maximum_pressure = 90*ONE_ATMOSPHERE
@@ -102,7 +103,7 @@
else if ((istype(W, /obj/item/device/analyzer) || (istype(W, /obj/item/device/pda))) && get_dist(user, src) <= 1) else if ((istype(W, /obj/item/device/analyzer) || (istype(W, /obj/item/device/pda))) && get_dist(user, src) <= 1)
for (var/mob/O in viewers(user, null)) for (var/mob/O in viewers(user, null))
O << "\red [user] has used [W] on \icon[icon]" O << "\red [user] has used [W] on \icon[icon]"
if(air_contents)
var/pressure = air_contents.return_pressure() var/pressure = air_contents.return_pressure()
var/total_moles = air_contents.total_moles() var/total_moles = air_contents.total_moles()
@@ -125,6 +126,8 @@
user << "\blue Temperature: [round(air_contents.temperature-T0C)]&deg;C" user << "\blue Temperature: [round(air_contents.temperature-T0C)]&deg;C"
else else
user << "\blue Tank is empty!" user << "\blue Tank is empty!"
else
user << "\blue Tank is empty!"
return return
return return

View File

@@ -22,12 +22,12 @@
if(src.occupant) if(src.occupant)
user << "\red The gibber is full, empty it first!" user << "\red The gibber is full, empty it first!"
return return
if(G.affecting.abiotic())
user << "\red Subject may not have abiotic items on."
return
if (!( istype(G, /obj/item/weapon/grab)) || !(istype(G.affecting, /mob/living/carbon/human))) if (!( istype(G, /obj/item/weapon/grab)) || !(istype(G.affecting, /mob/living/carbon/human)))
user << "\red This item is not suitable for the gibber!" user << "\red This item is not suitable for the gibber!"
return return
if(G.affecting.abiotic())
user << "\red Subject may not have abiotic items on."
return
user.visible_message("\red [user] starts to put [G.affecting] into the gibber!") user.visible_message("\red [user] starts to put [G.affecting] into the gibber!")
src.add_fingerprint(user) src.add_fingerprint(user)

View File

@@ -4,7 +4,9 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ") message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
defer_powernet_rebuild = 1 defer_powernet_rebuild = 1
if (!istype(epicenter, /turf))
epicenter = epicenter.loc
return explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range)
playsound(epicenter.loc, 'explosionfar.ogg', 100, 1, round(devastation_range*2,1) ) playsound(epicenter.loc, 'explosionfar.ogg', 100, 1, round(devastation_range*2,1) )
playsound(epicenter.loc, "explosion", 100, 1, round(devastation_range,1) ) playsound(epicenter.loc, "explosion", 100, 1, round(devastation_range,1) )

View File

@@ -123,6 +123,7 @@
W.loc = src W.loc = src
src.brain = W src.brain = W
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(src.loc)) var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(src.loc))
if (src.brain.owner)
O.gender = src.brain.owner.gender O.gender = src.brain.owner.gender
//O.start = 1 //O.start = 1
O.invisibility = 0 O.invisibility = 0

View File

@@ -163,7 +163,7 @@ WELDINGTOOOL
/obj/item/weapon/weldingtool/proc/eyecheck(mob/user as mob) /obj/item/weapon/weldingtool/proc/eyecheck(mob/user as mob)
//check eye protection //check eye protection
var/safety = null var/safety = null
if (istype(user, /mob/living/carbon/human))
if (istype(user:head, /obj/item/clothing/head/helmet/welding) || istype(user:head, /obj/item/clothing/head/helmet/space)) if (istype(user:head, /obj/item/clothing/head/helmet/welding) || istype(user:head, /obj/item/clothing/head/helmet/space))
safety = 2 safety = 2
else if (istype(user:glasses, /obj/item/clothing/glasses/sunglasses)) else if (istype(user:glasses, /obj/item/clothing/glasses/sunglasses))
@@ -172,6 +172,8 @@ WELDINGTOOOL
safety = -1 safety = -1
else else
safety = 0 safety = 0
else if(istype(user, /mob/living/carbon))
safety = 0
switch(safety) switch(safety)
if(1) if(1)
usr << "\red Your eyes sting a little." usr << "\red Your eyes sting a little."

View File

@@ -214,5 +214,6 @@
/obj/crate/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/crate/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(opened) if(opened)
user.drop_item() user.drop_item()
if(W)
W.loc = src.loc W.loc = src.loc
else return attack_hand(user) else return attack_hand(user)

View File

@@ -115,11 +115,13 @@
var/turf/T = src.loc var/turf/T = src.loc
if (ismob(T)) if (ismob(T))
T = T.loc T = T.loc
if (src.part1)
src.part1.loc = T src.part1.loc = T
src.part2.loc = T
src.part1.master = null src.part1.master = null
src.part2.master = null
src.part1 = null src.part1 = null
if (src.part2)
src.part2.loc = T
src.part2.master = null
src.part2 = null src.part2 = null
del(src) del(src)

View File

@@ -62,7 +62,9 @@
if (!msg) if (!msg)
return return
if (usr.client && usr.client.holder) if(usr)
if (usr.client)
if(usr.client.holder)
M << "\bold You hear a voice in your head... \italic [msg]" M << "\bold You hear a voice in your head... \italic [msg]"
log_admin("SubtlePM: [key_name(usr)] -> [key_name(M)] : [msg]") log_admin("SubtlePM: [key_name(usr)] -> [key_name(M)] : [msg]")

View File

@@ -43,6 +43,7 @@
..() ..()
statpanel("Status") statpanel("Status")
if (src.client.statpanel == "Status") if (src.client.statpanel == "Status")
if(emergency_shuttle)
if(emergency_shuttle.online && emergency_shuttle.location < 2) if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft() var/timeleft = emergency_shuttle.timeleft()
if (timeleft) if (timeleft)

View File

@@ -153,6 +153,7 @@
// if(ticker.mode.name == "AI malfunction") // if(ticker.mode.name == "AI malfunction")
// if(ticker.mode:malf_mode_declared) // if(ticker.mode:malf_mode_declared)
// stat(null, "Time left: [ ticker.mode:AI_win_timeleft]") // stat(null, "Time left: [ ticker.mode:AI_win_timeleft]")
if(emergency_shuttle)
if(emergency_shuttle.online && emergency_shuttle.location < 2) if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft() var/timeleft = emergency_shuttle.timeleft()
if (timeleft) if (timeleft)

View File

@@ -250,6 +250,8 @@
if(O2_pp < safe_oxygen_min) // Too little oxygen if(O2_pp < safe_oxygen_min) // Too little oxygen
if(prob(20)) if(prob(20))
spawn(0) emote("gasp") spawn(0) emote("gasp")
if (O2_pp == 0)
O2_pp = 0.01
var/ratio = safe_oxygen_min/O2_pp var/ratio = safe_oxygen_min/O2_pp
oxyloss += min(5*ratio, 7) // Don't fuck them up too fast (space only does 7 after all!) oxyloss += min(5*ratio, 7) // Don't fuck them up too fast (space only does 7 after all!)
oxygen_used = breath.oxygen*ratio/6 oxygen_used = breath.oxygen*ratio/6

View File

@@ -29,7 +29,7 @@
/mob/living/carbon/monkey/movement_delay() /mob/living/carbon/monkey/movement_delay()
var/tally = 0 var/tally = 0
if(src.reagents)
if(src.reagents.has_reagent("hyperzine")) return -1 if(src.reagents.has_reagent("hyperzine")) return -1
var/health_deficiency = (100 - src.health) var/health_deficiency = (100 - src.health)

View File

@@ -38,6 +38,7 @@
if (!src.client.changes) if (!src.client.changes)
src.changes() src.changes()
if(istype (src, /mob/living)) if(istype (src, /mob/living))
if(ticker)
if(ticker.mode.name == "revolution") if(ticker.mode.name == "revolution")
if ((src.mind in ticker.mode:revolutionaries) || (src.mind in ticker.mode:head_revolutionaries)) if ((src.mind in ticker.mode:revolutionaries) || (src.mind in ticker.mode:head_revolutionaries))
ticker.mode:update_rev_icons_added(src.mind) ticker.mode:update_rev_icons_added(src.mind)

View File

@@ -1438,7 +1438,8 @@
//we don't use message_admins here because the sender/receiver might get it too //we don't use message_admins here because the sender/receiver might get it too
for (var/mob/K in world) for (var/mob/K in world)
if(K && K.client && K.client.holder && K.key != usr.key && K.key != M.key) if(K)
if(K.client && K.client.holder && K.key != usr.key && K.key != M.key)
K << "<b><font color='blue'>PM: [key_name(usr, K)]->[key_name(M, K)]:</b> \blue [t]</font>" K << "<b><font color='blue'>PM: [key_name(usr, K)]->[key_name(M, K)]:</b> \blue [t]</font>"
..() ..()
return return
@@ -2024,7 +2025,9 @@
if(src.mob) if(src.mob)
var/mob/M = src.mob var/mob/M = src.mob
M.loc = null // HACK, but whatever, this works M.loc = null // HACK, but whatever, this works
var/obj/screen/boom = M.hud_used.station_explosion var/obj/screen/boom = M.hud_used.station_explosion
if (M.client)
M.client.screen += boom M.client.screen += boom
if(ticker) if(ticker)
switch(ticker.mode.name) switch(ticker.mode.name)

View File

@@ -222,7 +222,7 @@ mob/new_player
proc/AttemptLateSpawn(rank, maxAllowed) proc/AttemptLateSpawn(rank, maxAllowed)
if(IsJobAvailable(rank, maxAllowed)) if(IsJobAvailable(rank, maxAllowed))
var/mob/living/carbon/human/character = create_character() var/mob/living/carbon/human/character = create_character()
if (character)
character.Equip_Rank(rank, joined_late=1) character.Equip_Rank(rank, joined_late=1)
//add to manifest -- Commented out in favor of ManifestLateSpawn() -- TLE //add to manifest -- Commented out in favor of ManifestLateSpawn() -- TLE
@@ -231,7 +231,7 @@ mob/new_player
// t.fields["rank"] = rank // t.fields["rank"] = rank
ManifestLateSpawn(character) ManifestLateSpawn(character)
if(ticker)
if (ticker.current_state == GAME_STATE_PLAYING) if (ticker.current_state == GAME_STATE_PLAYING)
for (var/mob/living/silicon/ai/A in world) for (var/mob/living/silicon/ai/A in world)
if (!A.stat) if (!A.stat)
@@ -371,7 +371,7 @@ mob/new_player
preferences.copy_to(new_character) preferences.copy_to(new_character)
new_character.dna.ready_dna(new_character) new_character.dna.ready_dna(new_character)
if(mind)
mind.transfer_to(new_character) mind.transfer_to(new_character)