This commit is contained in:
Daveo 2001-08-15 15:05:44 +00:00
parent 55e36f25d3
commit 7a43d05c5f
9 changed files with 15 additions and 23 deletions

View File

@ -35,13 +35,6 @@ 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();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -28,6 +28,8 @@ public:
void render();
int getFrameCount() {return( FRM_BUTTERFLY_FLAP04 - FRM_BUTTERFLY_FLAP01 + 1 );}
u8 canBeCaughtByNet() {return( false );}
bool allowOffMap() {return(true);}
protected:
void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
};

View File

@ -162,14 +162,6 @@ 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();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -26,6 +26,8 @@ public:
void shutdown();
void setTargetHeading( s16 newTargetHeading ) {m_targetHeading = newTargetHeading;}
u8 hasBeenAttacked();
bool allowOffMap() {return(true);}
protected:
bool processSensor();
void processMovement( int _frames );

View File

@ -65,8 +65,8 @@ inline u8 Get(int X,int Y)
void render(DVECTOR &MapPos);
#endif
int getMapWidth() {return(MapWidth);}
int getMapHeight() {return(MapHeight);}
// int getMapWidth() {return(MapWidth);}
// int getMapHeight() {return(MapHeight);}
protected:
sLayerHdr *LayerHdr;

View File

@ -792,7 +792,7 @@ DVECTOR DP;
// Note: relies on tiles not being top or bottom of map tho!!
void CLevel::destroyMapTile(DVECTOR const &Pos)
{
int Width=CollisionLayer->getMapWidth();
int Width=getMapWidth();
DVECTOR MP=Pos;
const int ColT=COLLISION_TYPE_DESTRUCTABLE_FLOOR;
@ -855,8 +855,8 @@ DVECTOR DP;
/*****************************************************************************/
void CLevel::CreateTileStore()
{
int MapW=CollisionLayer->getMapWidth();
int MapH=CollisionLayer->getMapHeight();
int MapW=getMapWidth();
int MapH=getMapHeight();
int X,Y;
m_TileStoreCount=0;

View File

@ -719,6 +719,7 @@ if(PadGetDown(0)&PAD_R1)
#endif
#ifdef _STATE_DEBUG_
if(PadGetDown(0)&PAD_L1&&m_currentMode!=PLAYER_MODE_DEAD)
{
oldmode=m_currentMode;
@ -729,7 +730,7 @@ else if(oldmode!=-1&&!(PadGetHeld(0)&PAD_L1))
newmode=oldmode;
oldmode=-1;
}
#endif
if(newmode!=-1)
{
setMode((PLAYER_MODE)newmode);

View File

@ -461,7 +461,7 @@ DVECTOR const &MapSize=Lvl.getMapSize16();
DVECTOR const &ThingPos=thing->getPos();
// Will speed this up - doubt it, not now!!
if (i!=CThing::TYPE_PLAYER && (ThingPos.vx<0 || ThingPos.vx>=MapSize.vx || ThingPos.vy<0 || ThingPos.vy>=MapSize.vy))
if (!thing->allowOffMap() && (ThingPos.vx<0 || ThingPos.vx>=MapSize.vx || ThingPos.vy<0 || ThingPos.vy>=MapSize.vy))
{
thing->setToShutdown();
SYSTEM_DBGMSG("ThingOffMap: T:%i S:%i TXY%i %i, MWH%i %i\n",(int)thing->getThingType(),(int)thing->getThingSubType(),ThingPos.vx,ThingPos.vy,MapSize.vx,MapSize.vy);

View File

@ -198,7 +198,8 @@ virtual void leftThinkZone(int _frames) {}
CRECT const &getCollisionArea() {return m_collisionArea;}
DVECTOR const &getCollisionSize() {return m_collisionSize;}
virtual int canCollide() {return true;}
virtual int canCollide() {return (true);}
virtual bool allowOffMap() {return (false);}
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
int checkCollisionAgainstArea(CRECT *_rect);
void updateCollisionArea();
@ -254,6 +255,7 @@ public:
};
virtual TYPE getThingType() {return TYPE_PLAYER;}
virtual bool alwaysThink() {return(true);}
bool allowOffMap() {return(true);}
};