diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index f9c2c90dd57..c5ec1748419 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1267,6 +1267,7 @@ proc/is_hot(obj/item/W as obj) //Is this even used for anything besides balloons? Yes I took out the W:lit stuff because : really shouldnt be used. /proc/is_sharp(obj/item/W as obj) // For the record, WHAT THE HELL IS THIS METHOD OF DOING IT? + if(!W) return 0 if(W.sharp) return 1 return ( \ W.sharp || \ @@ -1374,4 +1375,4 @@ var/list/WALLITEMS = list( return 0 /proc/format_text(text) - return replacetext(replacetext(text,"\proper ",""),"\improper ","") \ No newline at end of file + return replacetext(replacetext(text,"\proper ",""),"\improper ","") diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index f2a069c4543..c781bb20c99 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -183,24 +183,25 @@ var/datum/gas_mixture/gas gas = location.remove_air(0.25*environment.total_moles) - var/heat_capacity = gas.heat_capacity() - var/energy_used = min( abs( heat_capacity*(gas.temperature - target_temperature) ), MAX_ENERGY_CHANGE) + if(gas) + var/heat_capacity = gas.heat_capacity() + var/energy_used = min( abs( heat_capacity*(gas.temperature - target_temperature) ), MAX_ENERGY_CHANGE) - //Use power. Assuming that each power unit represents 1000 watts.... - use_power(energy_used/1000, ENVIRON) + //Use power. Assuming that each power unit represents 1000 watts.... + use_power(energy_used/1000, ENVIRON) - //We need to cool ourselves. - if(environment.temperature > target_temperature) - gas.temperature -= energy_used/heat_capacity - else - gas.temperature += energy_used/heat_capacity + //We need to cool ourselves. + if(environment.temperature > target_temperature) + gas.temperature -= energy_used/heat_capacity + else + gas.temperature += energy_used/heat_capacity - environment.merge(gas) + environment.merge(gas) - if(abs(environment.temperature - target_temperature) <= 0.5) - regulating_temperature = 0 - visible_message("\The [src] clicks quietly as it stops [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\ - "You hear a click as a faint electronic humming stops.") + if(abs(environment.temperature - target_temperature) <= 0.5) + regulating_temperature = 0 + visible_message("\The [src] clicks quietly as it stops [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\ + "You hear a click as a faint electronic humming stops.") var/old_level = danger_level danger_level = overall_danger_level() @@ -1683,4 +1684,4 @@ Code shamelessly copied from apc_frame else usr << browse(null, "window=partyalarm") return - return \ No newline at end of file + return diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 5a0bdf4af30..df04ddfcfe7 100755 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -482,7 +482,8 @@ var/global/list/obj/item/device/pda/PDAs = list() return 0 if(!can_use()) //Why reinvent the wheel? There's a proc that does exactly that. U.unset_machine() - ui.close() + if(ui) + ui.close() return 0 add_fingerprint(U) diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index 8b9d914bc24..7ee3499c1cd 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -153,7 +153,7 @@ playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1) add_fingerprint(user) - if(blood_overlay && (blood_DNA.len >= 1)) //updates blood overlay, if any + if(blood_overlay && blood_DNA && (blood_DNA.len >= 1)) //updates blood overlay, if any overlays.Cut()//this might delete other item overlays as well but eeeeeeeh var/icon/I = new /icon(src.icon, src.icon_state) @@ -265,4 +265,4 @@ H.update_inv_r_hand() add_fingerprint(user) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 00368c2debd..8470095cde0 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -325,7 +325,7 @@ breath = loc.remove_air(breath_moles) - if(istype(wear_mask, /obj/item/clothing/mask/gas)) + if(istype(wear_mask, /obj/item/clothing/mask/gas) && breath) var/obj/item/clothing/mask/gas/G = wear_mask var/datum/gas_mixture/filtered = new diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm index 06f25a7e18b..d627a5c7713 100644 --- a/code/modules/projectiles/targeting.dm +++ b/code/modules/projectiles/targeting.dm @@ -269,7 +269,7 @@ client/proc/add_gun_icons() screen += usr.gun_run_icon client/proc/remove_gun_icons() - if(isnull(usr)) return 1 // Runtime prevention on N00k agents spawning with SMG + if(!usr) return 1 // Runtime prevention on N00k agents spawning with SMG screen -= usr.item_use_icon screen -= usr.gun_move_icon if (target_can_move) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index b48b96d3095..0897d64ef84 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -935,8 +935,9 @@ datum for(var/mob/living/carbon/slime/M in T) M.adjustToxLoss(rand(5,10)) reaction_turf(var/turf/simulated/S, var/volume) - if(volume >= 1) - S.dirt = 0 + if(istype(S)) + if(volume >= 1) + S.dirt = 0 reaction_mob(var/mob/M, var/method=TOUCH, var/volume) if(iscarbon(M)) @@ -3699,4 +3700,4 @@ datum return // Undefine the alias for REAGENTS_EFFECT_MULTIPLER -#undef REM \ No newline at end of file +#undef REM