Fixes a few runtimes

This commit is contained in:
Tastyfish
2016-05-23 18:58:50 -04:00
parent 87c13977af
commit 7efe0beb94
9 changed files with 28 additions and 21 deletions
+1 -1
View File
@@ -210,7 +210,7 @@
/obj/machinery/recharge_station/verb/move_inside(var/mob/user = usr)
set category = "Object"
set src in oview(1)
if(!user)
if(!user || !usr)
return
if (usr.stat != CONSCIOUS)
+5 -5
View File
@@ -66,8 +66,9 @@
smooth_icon(src)
if(!damage)
overlays -= damage_overlays[damage_overlay]
damage_overlay = 0
if(damage_overlay)
overlays -= damage_overlays[damage_overlay]
damage_overlay = 0
return
var/overlay = round(damage / damage_cap * damage_overlays.len) + 1
@@ -76,12 +77,11 @@
if(damage_overlay && overlay == damage_overlay) //No need to update.
return
overlays -= damage_overlays[damage_overlay]
if(damage_overlay)
overlays -= damage_overlays[damage_overlay]
overlays += damage_overlays[overlay]
damage_overlay = overlay
return
/turf/simulated/wall/proc/generate_overlays()
var/alpha_inc = 256 / damage_overlays.len
+2 -2
View File
@@ -3,7 +3,7 @@
/mob/living/carbon/human/proc/do_suicide(damagetype, byitem)
var/threshold = (config.health_threshold_crit + config.health_threshold_dead) / 2
var/dmgamt = maxHealth - threshold
var/damage_mod = 1
switch(damagetype) //Sorry about the magic numbers.
//brute = 1, burn = 2, tox = 4, oxy = 8
@@ -163,7 +163,7 @@
var/turf/T = get_turf_or_move(card.loc)
for (var/mob/M in viewers(T))
M.show_message("\blue [src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"", 3, "\blue [src] bleeps electronically.", 2)
death(0)
death(0, 1)
else
to_chat(src, "Aborting suicide attempt.")
+2 -1
View File
@@ -43,7 +43,8 @@
timer_end()
if((!secured)||(cooldown > 0)) return 0
pulse(0)
loc.visible_message("\icon[src] *beep* *beep*", "*beep* *beep*")
if(loc)
loc.visible_message("\icon[src] *beep* *beep*", "*beep* *beep*")
cooldown = 2
spawn(10)
process_cooldown()
+5 -4
View File
@@ -1,12 +1,13 @@
/mob/living/silicon/pai/death(gibbed)
/mob/living/silicon/pai/death(gibbed, cleanWipe)
if(stat == DEAD)
return
force_fold_out()
if(!cleanWipe)
force_fold_out()
var/turf/T = get_turf_or_move(loc)
for (var/mob/M in viewers(T))
M.show_message("\red [src] emits a dull beep before it loses power and collapses.", 3, "\red You hear a dull beep followed by the sound of glass crunching.", 2)
M.show_message("<span class=warning>[src] emits a dull beep before it loses power and collapses.</span>", 3, "<span class=warning>You hear a dull beep followed by the sound of glass crunching.</span>", 2)
name = "pAI debris"
desc = "The unfortunate remains of some poor personal AI device."
icon_state = "[chassis]_dead"
@@ -24,5 +25,5 @@
if(mind) qdel(mind)
living_mob_list -= src
ghostize()
if(icon_state != "[chassis]_dead")
if(icon_state != "[chassis]_dead" || cleanWipe)
qdel(src)
@@ -140,13 +140,15 @@
/mob/living/simple_animal/hostile/poison/bees/worker/Destroy()
if(beehome)
beehome.bees.Remove(src)
if(beehome.bees)
beehome.bees.Remove(src)
beehome = null
..()
/mob/living/simple_animal/hostile/poison/bees/worker/death(gibbed)
if(beehome)
beehome.bees.Remove(src)
if(beehome.bees)
beehome.bees.Remove(src)
beehome = null
..()
+1 -1
View File
@@ -40,7 +40,7 @@
usr.emote(message)
/mob/proc/say_dead(var/message)
if(!src.client.holder)
if(!(client && client.holder))
if(!config.dsay_allowed)
to_chat(src, "<span class='danger'>Deadchat is globally muted.</span>")
return
+4 -4
View File
@@ -31,7 +31,7 @@
return 0
if(target.get_species() == "Machine")//i know organ robot might be enough but i am not taking chances...
return 0
if(!affected.encased)//no bone, problem.
if(affected && !affected.encased) //no bone, problem.
return 0
return 1
@@ -43,9 +43,9 @@
if(affected && (affected.status & ORGAN_ROBOT))
return 0//no operating on robotic limbs in an organic surgery
if(!affected.encased)//no bones no problem.
return 1
return 0
if(affected && affected.encased) //no bones no problem.
return 0
return 1
/datum/surgery/organ_manipulation/alien/can_start(mob/user, mob/living/carbon/target)
if(istype(target,/mob/living/carbon/alien/humanoid))
+4 -1
View File
@@ -221,7 +221,10 @@ Any-Mode: (hotkey doesn't need to be on)
set name = "Set Hotkey Mode"
set category = "Preferences"
hotkeytype = input("Choose hotkey mode", "Hotkey mode") as null|anything in hotkeylist//ask the user for the hotkey type
var/hkt = input("Choose hotkey mode", "Hotkey mode") as null|anything in hotkeylist//ask the user for the hotkey type
if(!hkt)
return
hotkeytype = hkt
var/hotkeys = hotkeylist[hotkeytype]//get the list containing the hotkey names
var/hotkeyname = hotkeys[hotkeyon ? "on" : "off"]//get the name of the hotkey, to not clutter winset() to much