This commit is contained in:
Charles 2001-05-01 16:28:51 +00:00
parent 991083d6b5
commit 9df303b4e7
2 changed files with 33 additions and 0 deletions

View file

@ -27,6 +27,10 @@
#include "utils\utils.h"
#endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
#ifndef __HAZARD_HFALLING_H__
#include "hazard\hfalling.h"
#endif
@ -255,3 +259,30 @@ void CNpcHazard::render()
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcHazard::collidedWith( CThing *_thisThing )
{
if ( m_isActive )
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
if ( !player->isRecoveringFromHit() )
{
player->takeDamage( DAMAGE__HIT_ENEMY );
}
break;
}
default:
ASSERT(0);
break;
}
}
}