diff --git a/source/projectl/projectl.cpp b/source/projectl/projectl.cpp index e854bf815..1e375ae13 100644 --- a/source/projectl/projectl.cpp +++ b/source/projectl/projectl.cpp @@ -391,6 +391,13 @@ void CProjectile::think(int _frames) } } + CLevel &level = GameScene.GetLevel(); + if ( Pos.vx < 0 || Pos.vx > ( level.getCollisionLayer()->getMapWidth() << 4 ) || + Pos.vy < 0 || Pos.vy > ( level.getCollisionLayer()->getMapHeight() << 4 ) ) + { + setToShutdown(); + } + if ( m_lifetimeType == PROJECTILE_FINITE_LIFE ) { m_lifetime -= _frames; @@ -711,6 +718,13 @@ void CPlayerProjectile::think(int _frames) } } + CLevel &level = GameScene.GetLevel(); + if ( Pos.vx < 0 || Pos.vx > ( level.getCollisionLayer()->getMapWidth() << 4 ) || + Pos.vy < 0 || Pos.vy > ( level.getCollisionLayer()->getMapHeight() << 4 ) ) + { + setToShutdown(); + } + if ( m_lifetimeType == PLAYER_PROJECTILE_FINITE_LIFE ) { m_lifetime -= _frames;