From 4731a653baff69b9f675ae76be8d3d0c540539a7 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 15 Aug 2001 14:45:46 +0000 Subject: [PATCH] --- source/enemy/nbuttfly.cpp | 7 +++++++ source/enemy/nsjback.cpp | 8 ++++++++ source/projectl/projectl.cpp | 10 ++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/source/enemy/nbuttfly.cpp b/source/enemy/nbuttfly.cpp index 63858c199..1d6b5e828 100644 --- a/source/enemy/nbuttfly.cpp +++ b/source/enemy/nbuttfly.cpp @@ -35,6 +35,13 @@ void CNpcButterflyBackgroundEnemy::processMovementModifier(int _frames, s32 dist m_animPlaying = true; m_frame = 0; } + + CLevel &level = GameScene.GetLevel(); + if ( Pos.vx < 0 || Pos.vx > ( level.getCollisionLayer()->getMapWidth() << 4 ) || + Pos.vy < 0 || Pos.vy > ( level.getCollisionLayer()->getMapHeight() << 4 ) ) + { + setToShutdown(); + } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/nsjback.cpp b/source/enemy/nsjback.cpp index 052dae89c..86a05a42a 100644 --- a/source/enemy/nsjback.cpp +++ b/source/enemy/nsjback.cpp @@ -162,6 +162,14 @@ void CNpcSmallJellyfishBackgroundEnemy::processMovement( int _frames ) }*/ processMovementModifier( _frames, moveX, moveY, moveVel, moveDist ); + + CLevel &level = GameScene.GetLevel(); + DVECTOR const &MapSize=level.getMapSize16(); + if ( Pos.vx < 0 || Pos.vx >= MapSize.vx || + Pos.vy < 0 || Pos.vy >= MapSize.vy ) + { + setToShutdown(); + } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/projectl/projectl.cpp b/source/projectl/projectl.cpp index 63895c904..80b95653b 100644 --- a/source/projectl/projectl.cpp +++ b/source/projectl/projectl.cpp @@ -406,8 +406,9 @@ 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 ) ) + DVECTOR const &MapSize=level.getMapSize16(); + if ( Pos.vx < 0 || Pos.vx >= MapSize.vx || + Pos.vy < 0 || Pos.vy >= MapSize.vy ) { setToShutdown(); } @@ -733,8 +734,9 @@ 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 ) ) + DVECTOR const &MapSize=level.getMapSize16(); + if ( Pos.vx < 0 || Pos.vx >= MapSize.vx || + Pos.vy < 0 || Pos.vy >= MapSize.vy ) { setToShutdown(); }