TwoPointFive icon indicating copy to clipboard operation
TwoPointFive copied to clipboard

Fix misalignment of grenade projectile sprite after recycling

Open nicklockwood opened this issue 8 years ago • 0 comments

After a grenade entity was recycled from the EntityPool, the offset compensation for the sprite size wasn't being applied, with the result that the sprite was offset to the right with respect the barrel of the grenade launcher.

This fix applies the same offset when resetting a recycled grenade as is applied when it's first created.

Note: It would be more robust if there was a way to share the setup code between the init and reset functions, since they are mostly identical, but I'm not sure how best to do that given the need to call this.parent().

nicklockwood avatar May 30 '16 15:05 nicklockwood