This commit is contained in:
Charles 2001-05-08 16:25:45 +00:00
parent 26d50aa503
commit 9beaeed67a
7 changed files with 88 additions and 30 deletions

View file

@ -83,6 +83,29 @@ void CNpcDualPlatform::setWaypoints( sThingPlatform *ThisPlatform )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
u8 CNpcDualPlatform::canDrop()
{
if ( m_isMaster )
{
s32 extensionLeft = m_maxExtension - m_extension;
if ( extensionLeft == 0 )
{
return( false );
}
else
{
return( true );
}
}
else
{
return( false );
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcDualPlatform::processMovement( int _frames )
{
if ( m_isMaster )

View file

@ -24,6 +24,7 @@ public:
void setMaster( u8 isMaster );
void setOtherPlatform( CNpcDualPlatform *other );
void setMovement( DVECTOR move );
virtual u8 canDrop();
protected:
virtual void setWaypoints( sThingPlatform *ThisPlatform );
virtual void processMovement( int _frames );

View file

@ -29,6 +29,10 @@
#include "player\player.h"
#endif
#ifndef __HAZARD_HAZARD_H__
#include "hazard\hazard.h"
#endif
#ifndef __ENEMY_NPCPATH_H__
#include "enemy\npcpath.h"
#endif
@ -826,6 +830,20 @@ void CNpcPlatform::collidedWith( CThing *_thisThing )
{
m_contact = true;
CNpcHazard *hazard;
hazard = (CNpcHazard *)_thisThing;
hazard->setPlatform( this );
/*DVECTOR newPos = _thisThing->getPos();
s32 yDiff = getHeightFromPlatformAtPosition( newPos.vx, newPos.vy );
newPos.vy += yDiff;
_thisThing->setPos( newPos );*/
break;
}

View file

@ -91,6 +91,7 @@ public:
void shutdown();
virtual void think(int _frames);
virtual void render();
virtual u8 canDrop() {return true;}
void setType( NPC_PLATFORM_UNIT_TYPE newType ) {m_type = newType;}
void setTypeFromMapEdit( u16 newType );
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}