From e9dcbd5916eaab6018f3cfdd862b8b85ba464899 Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Tue, 1 May 2012 00:17:29 +0100 Subject: [PATCH] TG: - Fixed one of the ways the Core R&D Computer can lock up and become completely unusable. If it gets stuck from using this method, just close the window and click on the computer again. Fixes issue 316 . - Vaccine bottles from the panD.E.M.I.C. now auto-name. There was a bug where you could very quickly create a ton of bottles which could cause clients to crash. Fixes issue 326 . - Changed various ASSERT()'s to sanity ifs. ASSERT should really only be used during debugging, not in release. Runtime prevention. Revision: r3368 Author: johnsonmt88 --- code/datums/diseases/alien_embryo.dm | 2 +- code/datums/diseases/robotic_transformation.dm | 2 +- code/datums/diseases/xeno_transformation.dm | 2 +- code/defines/procs/AStar.dm | 4 ++-- code/defines/procs/icon_procs.dm | 2 +- code/game/hud.dm | 2 +- code/game/mecha/mech_fabricator.dm | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/datums/diseases/alien_embryo.dm b/code/datums/diseases/alien_embryo.dm index e13b4875a01..8be2fa5c1c9 100644 --- a/code/datums/diseases/alien_embryo.dm +++ b/code/datums/diseases/alien_embryo.dm @@ -59,7 +59,7 @@ affected_mob.adjustToxLoss(10) affected_mob.updatehealth() if(prob(40)) - ASSERT(gibbed == 0) + if(gibbed != 0) return 0 var/list/candidates = list() // Picks a random ghost in the world to shove in the larva -- TLE for(var/mob/dead/observer/G in world) if(G.client) diff --git a/code/datums/diseases/robotic_transformation.dm b/code/datums/diseases/robotic_transformation.dm index d68952d9a0b..34b074e34f4 100644 --- a/code/datums/diseases/robotic_transformation.dm +++ b/code/datums/diseases/robotic_transformation.dm @@ -52,7 +52,7 @@ affected_mob.adjustToxLoss(10) affected_mob.updatehealth() if(prob(40)) //So everyone can feel like robot Seth Brundle - ASSERT(src.gibbed == 0) + if(src.gibbed != 0) return 0 var/turf/T = find_loc(affected_mob) gibs(T) src.cure(0) diff --git a/code/datums/diseases/xeno_transformation.dm b/code/datums/diseases/xeno_transformation.dm index f3a822fb952..9d3289708ff 100644 --- a/code/datums/diseases/xeno_transformation.dm +++ b/code/datums/diseases/xeno_transformation.dm @@ -52,7 +52,7 @@ affected_mob.adjustToxLoss(10) affected_mob.updatehealth() if(prob(40)) - ASSERT(gibbed == 0) + if(gibbed != 0) return 0 var/turf/T = find_loc(affected_mob) gibs(T) src.cure(0) diff --git a/code/defines/procs/AStar.dm b/code/defines/procs/AStar.dm index 988a3a2225f..d106e8f64fa 100644 --- a/code/defines/procs/AStar.dm +++ b/code/defines/procs/AStar.dm @@ -57,12 +57,12 @@ PriorityQueue j >>= 1 Dequeue() - ASSERT(L.len) + if(!L.len) return 0 . = L[1] Remove(1) Remove(i) - ASSERT(i <= L.len) + if(i > L.len) return 0 L.Swap(i,L.len) L.Cut(L.len) if(i < L.len) diff --git a/code/defines/procs/icon_procs.dm b/code/defines/procs/icon_procs.dm index 3069645c828..16245997006 100644 --- a/code/defines/procs/icon_procs.dm +++ b/code/defines/procs/icon_procs.dm @@ -448,7 +448,7 @@ proc currentLayer = current:layer if(currentLayer<0) // Special case for FLY_LAYER - ASSERT(currentLayer > -1000) + if(currentLayer <= -1000) return 0 if(pSet == 0) // Underlay currentLayer = A.layer+currentLayer/1000 else // Overlay diff --git a/code/game/hud.dm b/code/game/hud.dm index 1b4c2fae2d2..4d60c7d50ac 100644 --- a/code/game/hud.dm +++ b/code/game/hud.dm @@ -87,7 +87,7 @@ obj/hud/New(var/type = 0) /obj/hud/proc/instantiate(var/type = 0) mymob = loc - ASSERT(istype(mymob, /mob)) + if(!istype(mymob, /mob)) return 0 if(ishuman(mymob)) human_hud(mymob.UI) // Pass the player the UI style chosen in preferences diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 9f9c9eee3e2..0bb8336a7f8 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -198,7 +198,7 @@ if(part) parts[i] = part //debug below - ASSERT(istype(parts[i],/obj/item)) + if(!istype(parts[i],/obj/item)) return 0 return