This commit is contained in:
parent
991083d6b5
commit
9df303b4e7
2 changed files with 33 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue