Skip to content

Commit

Permalink
Fixes some runtimes, involving do_mob, observe, send_status on mulebo…
Browse files Browse the repository at this point in the history
…ts, check_gas_mixture, the explosion cinematic, sleeper get_reagents_amount, and a possible (albeit unlikely) fix for throw_at

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3478 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
[email protected] committed Apr 19, 2012
1 parent 38957e7 commit 1b74952
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 26 deletions.
1 change: 1 addition & 0 deletions code/FEA/FEA_gas_mixture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ datum
return share(sharer)*/

check_gas_mixture(datum/gas_mixture/sharer)
if(!sharer) return 0
var/delta_oxygen = (oxygen_archived - sharer.oxygen_archived)/5
var/delta_carbon_dioxide = (carbon_dioxide_archived - sharer.carbon_dioxide_archived)/5
var/delta_nitrogen = (nitrogen_archived - sharer.nitrogen_archived)/5
Expand Down
1 change: 1 addition & 0 deletions code/defines/procs/helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@ proc/listclearnulls(list/list)
var/target_loc = target.loc
var/holding = user.equipped()
sleep(time)
if(!user || !target) return 0
if ( user.loc == user_loc && target.loc == target_loc && user.equipped() == holding && !( user.stat ) && ( !user.stunned && !user.weakened && !user.paralysis && !user.lying ) )
return 1
else
Expand Down
11 changes: 6 additions & 5 deletions code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@
dat += text("[]\t-Toxin Content %: []</FONT><BR>", (occupant.getToxLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getToxLoss())
dat += text("[]\t-Burn Severity %: []</FONT><BR>", (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getFireLoss())
dat += text("<HR>Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
dat += text("Inaprovaline units: [] units<BR>", occupant.reagents.get_reagent_amount("inaprovaline"))
dat += text("Soporific: [] units<BR>", occupant.reagents.get_reagent_amount("stoxin"))
dat += text("Dermaline: [] units<BR>", occupant.reagents.get_reagent_amount("dermaline"))
dat += text("Bicaridine: [] units<BR>", occupant.reagents.get_reagent_amount("bicaridine"))
dat += text("Dexalin: [] units<BR>", occupant.reagents.get_reagent_amount("dexalin"))
if(occupant.reagents)
dat += text("Inaprovaline units: [] units<BR>", occupant.reagents.get_reagent_amount("inaprovaline"))
dat += text("Soporific: [] units<BR>", occupant.reagents.get_reagent_amount("stoxin"))
dat += text("Dermaline: [] units<BR>", occupant.reagents.get_reagent_amount("dermaline"))
dat += text("Bicaridine: [] units<BR>", occupant.reagents.get_reagent_amount("bicaridine"))
dat += text("Dexalin: [] units<BR>", occupant.reagents.get_reagent_amount("dexalin"))
dat += text("<HR><A href='?src=\ref[];refresh=1'>Refresh meter readings each second</A><BR><A href='?src=\ref[];inap=1'>Inject Inaprovaline</A><BR><A href='?src=\ref[];stox=1'>Inject Soporific</A><BR><A href='?src=\ref[];derm=1'>Inject Dermaline</A><BR><A href='?src=\ref[];bic=1'>Inject Bicaridine</A><BR><A href='?src=\ref[];dex=1'>Inject Dexalin</A>", src, src, src, src, src, src)
else
dat += "The sleeper is empty."
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/bots/mulebot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@
var/list/kv = list(
"type" = "mulebot",
"name" = suffix,
"loca" = loc.loc, // area
"loca" = (loc ? loc.loc : "Unknown"), // somehow loc can be null and cause a runtime - Quarxink
"mode" = mode,
"powr" = (cell ? cell.percent() : 0),
"dest" = destination,
Expand Down
3 changes: 1 addition & 2 deletions code/game/throwing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
..()

/atom/movable/proc/throw_at(atom/target, range, speed)
if(!target) return 0
if(!target || !src) return 0
//use a modified version of Bresenham's algorithm to get from the atom's current position to that of the target
src.throwing = 1

Expand Down Expand Up @@ -182,7 +182,6 @@
if(dist_since_sleep >= speed)
dist_since_sleep = 0
sleep(1)

a = get_area(src.loc)
else
var/error = dist_y/2 - dist_x
Expand Down
39 changes: 21 additions & 18 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,11 @@
for (var/mob/living/silicon/decoy/D in world)
if (eye)
eye = D
if (eye)
client.eye = eye
else
client.eye = client.mob
if (client)
if (eye)
client.eye = eye
else
client.eye = client.mob

/mob/verb/cancel_camera()
set name = "Cancel Camera View"
Expand Down Expand Up @@ -959,22 +960,24 @@ note dizziness decrements automatically in the mob's Life() proc.
boom.icon_state = "start"

sleep(40)
mob << sound('explosionfar.ogg')
boom.icon_state = "end"
if(!station_missed) flick("explode", boom)
else flick("explode2", boom)
if(boom && mob)
mob << sound('explosionfar.ogg')
boom.icon_state = "end"
if(!station_missed) flick("explode", boom)
else flick("explode2", boom)
sleep(40)

switch(ticker.mode.name)
if("nuclear emergency")
if(!station_missed) boom.icon_state = "loss_nuke"
else boom.icon_state = "loss_nuke2"
if("malfunction")
boom.icon_state = "loss_malf"
if("blob")
return//Nothin here yet and the general one does not fit.
else
boom.icon_state = "loss_general"
if(boom)
switch(ticker.mode.name)
if("nuclear emergency")
if(!station_missed) boom.icon_state = "loss_nuke"
else boom.icon_state = "loss_nuke2"
if("malfunction")
boom.icon_state = "loss_malf"
if("blob")
return//Nothin here yet and the general one does not fit.
else
boom.icon_state = "loss_general"
return


Expand Down

0 comments on commit 1b74952

Please sign in to comment.