diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm
index 5f42f95020..9f3f08b245 100644
--- a/code/game/objects/explosion.dm
+++ b/code/game/objects/explosion.dm
@@ -1,69 +1,62 @@
//TODO: Flash range does nothing currently
+//A very crude linear approximatiaon of pythagoras theorem.
+/proc/cheap_pythag(var/dx, var/dy)
+ dx = abs(dx); dy = abs(dy);
+ if(dx>=dy) return dx + (0.5*dy) //The longest side add half the shortest side approximates the hypotenuse
+ else return dy + (0.5*dx)
+
+
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
- spawn()
+ spawn(0)
+ var/start = world.timeofday
+ epicenter = get_turf(epicenter)
if(!epicenter) return
+ if(adminlog)
+ message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])")
+ log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
+
+ playsound(epicenter, 'explosionfar.ogg', 100, 1, round(devastation_range*2,1) )
+ playsound(epicenter, "explosion", 100, 1, round(devastation_range,1) )
+
+ tension_master.explosion()
+
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1
- if (!istype(epicenter, /turf))
- epicenter = get_turf(epicenter.loc)
-
- playsound(epicenter.loc, 'explosionfar.ogg', 100, 1, round(devastation_range*2,1) )
- playsound(epicenter.loc, "explosion", 100, 1, round(devastation_range,1) )
-
- if (adminlog)
- message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
- log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
-
- tension_master.explosion()
-
if(heavy_impact_range > 1)
var/datum/effect/system/explosion/E = new/datum/effect/system/explosion()
E.set_up(epicenter)
E.start()
- var/list/expTurfs = range(epicenter, max(devastation_range, heavy_impact_range, light_impact_range))
+ var/x0 = epicenter.x
+ var/y0 = epicenter.y
+ var/z0 = epicenter.z
- // Hello future editors, please note that 1000 calls to spawn will not speed this up, but this exact amount has been tested
- // Now, tonnes of calls to spawn will allow other stuff to happen, but I believe we may as well let explosions
- // Get over with and blow up like an explosion would
-
- var/list/dTurfs = list()
- var/list/hTurfs = list()
- var/list/lTurfs = list()
-
- for(var/turf/T in expTurfs) // This doesn't slow it down at all, even 100,100,100 bombs
- var/dist = approx_dist(epicenter, T)
+ for(var/turf/T in range(epicenter, max(devastation_range, heavy_impact_range, light_impact_range)))
+ var/dist = cheap_pythag(T.x - x0,T.y - y0)
if(dist < devastation_range)
- dTurfs.Add(T)
+ dist = 1
else if(dist < heavy_impact_range)
- hTurfs.Add(T)
- else // The expTurfs list only has turfs that are in it's range, so no if here for light_impact
- lTurfs.Add(T)
-
- // Lag from hereon
- for(var/turf/T in dTurfs)
- if(prob(10))
- T.ex_act(2)
+ dist = 2
+ else if(dist < light_impact_range)
+ dist = 3
else
- T.ex_act(1)
- for(var/atom/object in T.contents)
- object.ex_act(1)
- for(var/turf/T in hTurfs)
- T.ex_act(2)
- for(var/atom/object in T.contents)
- object.ex_act(2)
+ continue
- for(var/turf/T in lTurfs)
- T.ex_act(3)
- for(var/atom/object in T.contents)
- object.ex_act(3)
+ T.ex_act(dist)
+ if(T)
+ for(var/atom/object in T.contents)
+ object.ex_act(dist)
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0
+
+ //here util we get explosions to be less laggy, might help us identify issues after changes to splosions (because let's face it we've had a few)
+ world.log << "## Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [(world.timeofday-start)/10] seconds."
+
return 1
diff --git a/code/game/objects/items/helper_procs.dm b/code/game/objects/items/helper_procs.dm
index 334ec2e5e2..16d5bd2db6 100644
--- a/code/game/objects/items/helper_procs.dm
+++ b/code/game/objects/items/helper_procs.dm
@@ -30,17 +30,15 @@
else
return
-/proc/get_turf(turf/location as turf)
- while (location)
- if (istype(location, /turf))
+/proc/get_turf(turf/location)
+ while(location)
+ if(isturf(location))
return location
-
location = location.loc
return null
-/proc/get_turf_or_move(turf/location as turf)
- location = get_turf(location)
- return location
+/proc/get_turf_or_move(turf/location)
+ return get_turf(location)
diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm
index 67780edae4..4217a7f9fc 100644
--- a/code/modules/admin/admin_investigate.dm
+++ b/code/modules/admin/admin_investigate.dm
@@ -22,7 +22,7 @@
F << "[time2text(world.timeofday,"hh:mm")] \ref[src] ([x],[y],[z]) || [src] [message]
"
//ADMINVERBS
-/client/proc/investigate_show( subject in list("hrefs","singulo") )
+/client/proc/investigate_show( subject in list("hrefs","notes","singulo") )
set name = "Investigate"
set category = "Admin"
if(!holder) return
@@ -44,3 +44,5 @@
else
src << "Error: admin_investigate: Href Logging is not on."
return
+ if("notes")
+ holder.notes_show()
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 9406ca60af..aea2c84dc4 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -73,7 +73,7 @@
update_canmove()
//Update our name based on whether our face is obscured/disfigured
- name = get_visible_name() //TODO: this was broken by the dismemberment revert ~Carn
+ name = get_visible_name()
handle_regular_hud_updates()