tgstation/-tg-station — pull request #2232 by ChuckTheSheep (2014-01-04 03:23:24+00:00)
Title: Optimized Explosion

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