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,9 +48,11 @@ obj/machinery/atmospherics/valve
if(open)
if(reference == node1)
return node2.network_expand(new_network, src)
if(node2)
return node2.network_expand(new_network, src)
else if(reference == node2)
return node1.network_expand(new_network, src)
if(node1)
return node1.network_expand(new_network, src)
return null

View File

@@ -120,16 +120,17 @@ datum
reagent_state = LIQUID
reaction_turf(var/turf/T, var/volume)
src = null
if(T:wet >= 2) return
T:wet = 2
spawn(800)
T:wet = 0
if(T:wet_overlay)
T:overlays -= T:wet_overlay
T:wet_overlay = null
if (!istype(T, /turf/space))
src = null
if(T:wet >= 2) return
T:wet = 2
spawn(800)
T:wet = 0
if(T:wet_overlay)
T:overlays -= T:wet_overlay
T:wet_overlay = null
return
return
bilk
name = "Bilk"

View File

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

View File

@@ -141,7 +141,8 @@
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)
if(prob(prob_right_job))
changeling_job = correct_mob:assigned_role
if(correct_mob)
changeling_job = correct_mob:assigned_role
else
var/list/job_tmp = get_all_jobs()
changeling_job = pick(job_tmp)

View File

@@ -132,22 +132,23 @@ datum
check_completion()
if(steal_target)
if(owner.current.check_contents_for(steal_target))
if(target_name == "functional ai")
// world << "dude's after an AI, time to check for one."
for(var/obj/item/device/aicard/C in owner.current.contents)
// world << "Found an intelicard, checking it for an AI"
for(var/mob/living/silicon/ai/M in C)
// world << "Found an AI, checking if it's alive"
if(istype(M, /mob/living/silicon/ai) && M.stat != 2)
// world << "yay, you win!"
return 1
if(owner.current)
if(owner.current.check_contents_for(steal_target))
if(target_name == "functional ai")
// world << "dude's after an AI, time to check for one."
for(var/obj/item/device/aicard/C in owner.current.contents)
// world << "Found an intelicard, checking it for an AI"
for(var/mob/living/silicon/ai/M in C)
// world << "Found an AI, checking if it's alive"
if(istype(M, /mob/living/silicon/ai) && M.stat != 2)
// world << "yay, you win!"
return 1
// world << "didn't find a living AI on the card"
return 0
return 0
else
return 1
else
return 1
else
return 0
return 0
nuclear
explanation_text = "Destroy the station with a nuclear device."

View File

@@ -13,7 +13,6 @@
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

@@ -7,6 +7,7 @@
var/volume = 0
var/destroyed = 0
var/throwforce = 0
var/maximum_pressure = 90*ONE_ATMOSPHERE
@@ -102,27 +103,29 @@
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))
O << "\red [user] has used [W] on \icon[icon]"
if(air_contents)
var/pressure = air_contents.return_pressure()
var/total_moles = air_contents.total_moles()
var/pressure = air_contents.return_pressure()
var/total_moles = air_contents.total_moles()
user << "\blue Results of analysis of \icon[icon]"
if (total_moles>0)
var/o2_concentration = air_contents.oxygen/total_moles
var/n2_concentration = air_contents.nitrogen/total_moles
var/co2_concentration = air_contents.carbon_dioxide/total_moles
var/plasma_concentration = air_contents.toxins/total_moles
user << "\blue Results of analysis of \icon[icon]"
if (total_moles>0)
var/o2_concentration = air_contents.oxygen/total_moles
var/n2_concentration = air_contents.nitrogen/total_moles
var/co2_concentration = air_contents.carbon_dioxide/total_moles
var/plasma_concentration = air_contents.toxins/total_moles
var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+plasma_concentration)
var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+plasma_concentration)
user << "\blue Pressure: [round(pressure,0.1)] kPa"
user << "\blue Nitrogen: [round(n2_concentration*100)]%"
user << "\blue Oxygen: [round(o2_concentration*100)]%"
user << "\blue CO2: [round(co2_concentration*100)]%"
user << "\blue Plasma: [round(plasma_concentration*100)]%"
if(unknown_concentration>0.01)
user << "\red Unknown: [round(unknown_concentration*100)]%"
user << "\blue Temperature: [round(air_contents.temperature-T0C)]&deg;C"
user << "\blue Pressure: [round(pressure,0.1)] kPa"
user << "\blue Nitrogen: [round(n2_concentration*100)]%"
user << "\blue Oxygen: [round(o2_concentration*100)]%"
user << "\blue CO2: [round(co2_concentration*100)]%"
user << "\blue Plasma: [round(plasma_concentration*100)]%"
if(unknown_concentration>0.01)
user << "\red Unknown: [round(unknown_concentration*100)]%"
user << "\blue Temperature: [round(air_contents.temperature-T0C)]&deg;C"
else
user << "\blue Tank is empty!"
else
user << "\blue Tank is empty!"
return

View File

@@ -22,12 +22,12 @@
if(src.occupant)
user << "\red The gibber is full, empty it first!"
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)))
user << "\red This item is not suitable for the gibber!"
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!")
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] ")
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, "explosion", 100, 1, round(devastation_range,1) )

View File

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

View File

@@ -163,14 +163,16 @@ WELDINGTOOOL
/obj/item/weapon/weldingtool/proc/eyecheck(mob/user as mob)
//check eye protection
var/safety = null
if (istype(user:head, /obj/item/clothing/head/helmet/welding) || istype(user:head, /obj/item/clothing/head/helmet/space))
safety = 2
else if (istype(user:glasses, /obj/item/clothing/glasses/sunglasses))
safety = 1
else if (istype(user:glasses, /obj/item/clothing/glasses/thermal))
safety = -1
else
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))
safety = 2
else if (istype(user:glasses, /obj/item/clothing/glasses/sunglasses))
safety = 1
else if (istype(user:glasses, /obj/item/clothing/glasses/thermal))
safety = -1
else
safety = 0
else if(istype(user, /mob/living/carbon))
safety = 0
switch(safety)
if(1)

View File

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

View File

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

View File

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

View File

@@ -43,10 +43,11 @@
..()
statpanel("Status")
if (src.client.statpanel == "Status")
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
if(emergency_shuttle)
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
/mob/dead/observer/proc/reenter_corpse()
set category = "Special Verbs"

View File

@@ -153,10 +153,11 @@
// if(ticker.mode.name == "AI malfunction")
// if(ticker.mode:malf_mode_declared)
// stat(null, "Time left: [ ticker.mode:AI_win_timeleft]")
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
if(emergency_shuttle)
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
if (src.client.statpanel == "Status")
if (src.internal)
@@ -1088,7 +1089,7 @@
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
src.wear_suit.screen_loc = ui_oclothing
if (istype(src.wear_suit, /obj/item/clothing/suit/straight_jacket))
if (src.handcuffed)
src.handcuffed.loc = src.loc

View File

@@ -250,6 +250,8 @@
if(O2_pp < safe_oxygen_min) // Too little oxygen
if(prob(20))
spawn(0) emote("gasp")
if (O2_pp == 0)
O2_pp = 0.01
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!)
oxygen_used = breath.oxygen*ratio/6

View File

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

View File

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

View File

@@ -1438,8 +1438,9 @@
//we don't use message_admins here because the sender/receiver might get it too
for (var/mob/K in world)
if(K && 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>"
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>"
..()
return
@@ -2024,26 +2025,28 @@
if(src.mob)
var/mob/M = src.mob
M.loc = null // HACK, but whatever, this works
var/obj/screen/boom = M.hud_used.station_explosion
M.client.screen += boom
if(ticker)
switch(ticker.mode.name)
if("nuclear emergency")
flick("start_nuke", boom)
if("AI malfunction")
flick("start_malf", boom)
else
boom.icon_state = "start"
sleep(40)
M << sound('explosionfar.ogg')
boom.icon_state = "end"
flick("explode", boom)
sleep(40)
if(ticker)
switch(ticker.mode.name)
if("nuclear emergency")
boom.icon_state = "loss_nuke"
if("AI malfunction")
boom.icon_state = "loss_malf"
else
boom.icon_state = "loss_general"
if (M.client)
M.client.screen += boom
if(ticker)
switch(ticker.mode.name)
if("nuclear emergency")
flick("start_nuke", boom)
if("AI malfunction")
flick("start_malf", boom)
else
boom.icon_state = "start"
sleep(40)
M << sound('explosionfar.ogg')
boom.icon_state = "end"
flick("explode", boom)
sleep(40)
if(ticker)
switch(ticker.mode.name)
if("nuclear emergency")
boom.icon_state = "loss_nuke"
if("AI malfunction")
boom.icon_state = "loss_malf"
else
boom.icon_state = "loss_general"

View File

@@ -222,24 +222,24 @@ mob/new_player
proc/AttemptLateSpawn(rank, maxAllowed)
if(IsJobAvailable(rank, maxAllowed))
var/mob/living/carbon/human/character = create_character()
character.Equip_Rank(rank, joined_late=1)
if (character)
character.Equip_Rank(rank, joined_late=1)
//add to manifest -- Commented out in favor of ManifestLateSpawn() -- TLE
//for(var/datum/data/record/t in data_core.general)
// if((t.fields["name"] == character.real_name) && (t.fields["rank"] == "Unassigned"))
// t.fields["rank"] = rank
ManifestLateSpawn(character)
ManifestLateSpawn(character)
if(ticker)
if (ticker.current_state == GAME_STATE_PLAYING)
for (var/mob/living/silicon/ai/A in world)
if (!A.stat)
A.say("[character.real_name] has signed up as [rank].")
if (ticker.current_state == GAME_STATE_PLAYING)
for (var/mob/living/silicon/ai/A in world)
if (!A.stat)
A.say("[character.real_name] has signed up as [rank].")
var/starting_loc = pick(latejoin)
character.loc = starting_loc
del(src)
var/starting_loc = pick(latejoin)
character.loc = starting_loc
del(src)
else
src << alert("[rank] is not available. Please try another.")
@@ -371,8 +371,8 @@ mob/new_player
preferences.copy_to(new_character)
new_character.dna.ready_dna(new_character)
mind.transfer_to(new_character)
if(mind)
mind.transfer_to(new_character)
return new_character