Fixes intermittent teleport-to-(0,0) bullet issue. Dead shields were still being...
authordsc <david.schoonover@gmail.com>
Sat, 12 Mar 2011 17:23:37 +0000 (09:23 -0800)
committerdsc <david.schoonover@gmail.com>
Sat, 12 Mar 2011 17:23:37 +0000 (09:23 -0800)
commit46f85d1f7ed05bee1ed24c94adee8992f010d9da
tree730541c2a013c08ecc9d725943987d421609d1cf
parent91d10053df91be1bbfb4f3c1109a60c241aacfad
Fixes intermittent teleport-to-(0,0) bullet issue. Dead shields were still being notified to act(), despite being correctly removed from all the bookkeeping locations (pathmap, game, etc) ... except owner.components. This itself would have just been a memory leak except that act() did not test whether the shield was alive. So when a dead shield would move, it could still hit things--it was only looking for things to hit and not testing if it was itself dead. These phantom collisions would result in NaN coords, which becomes 0 when coerced to int by DOMElement. Bam.
src/ezl/util/tree/quadtree.cjs
src/tanks/map/pathing/traversal.cjs
src/tanks/thing/component.cjs
src/tanks/thing/player.cjs
src/tanks/thing/shield.cjs
src/tanks/thing/thing.cjs