tgstation/-tg-station — pull request #2231 by ChuckTheSheep (2014-01-04 03:06:06+00:00)
Title: Explosion optimization + Set Backgrounds

Optimized explosion code with a simple edit/implementation of "trange()"
which is like range but it only handles turfs. Internally range goes
through all atoms, trange makes use of block() which only processes
turfs. Thus a less intensive implementation.

Also used the dist var being calculated and added spawn()s making the damage
happen from center outwards and the slight delays lets the code
"breathe" so to speak.

proc/explosion in profile:
Explosion with size (3, 5, 7, 0) "big bomb"

Before:
Self CPU: 0.006
Total CPU: 1.215
Real Time: 1.785
Calls: 1

After:
Self CPU: 0.002
Total CPU: 0.787
Real Time: 1.514
Calls: 1

Added defines to disable set background setting on procs. Default is
off. https://github.com/tgstation/-tg-station/pull/2175