This commit is contained in:
parent
b061d250d6
commit
5e15b2b759
@ -250,6 +250,30 @@ void CNpcFriend::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcFriend::collidedWith( CThing *_thisThing )
|
||||
{
|
||||
switch(_thisThing->getThingType())
|
||||
{
|
||||
case TYPE_PLAYER:
|
||||
{
|
||||
CPlayer *player = (CPlayer *) _thisThing;
|
||||
|
||||
if ( player->isTryingToConversateWithFriend() )
|
||||
{
|
||||
startConderversation();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcFriend::startConderversation()
|
||||
{
|
||||
// I am 'avin a fayg
|
||||
|
@ -76,6 +76,8 @@ protected:
|
||||
|
||||
void startConderversation();
|
||||
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
|
||||
enum
|
||||
{
|
||||
EXTEND_RIGHT = true,
|
||||
|
@ -171,6 +171,19 @@ void CThingManager::thinkAllThings(int _frames)
|
||||
thing1=thing1->m_nextThing;
|
||||
}
|
||||
|
||||
// Player -> Friend collision
|
||||
thing1=s_thingLists[CThing::TYPE_NPC];
|
||||
thing2=s_thingLists[CThing::TYPE_PLAYER];
|
||||
while(thing1&&thing2)
|
||||
{
|
||||
if(thing1->canCollide()&&
|
||||
thing1->checkCollisionAgainst(thing2, _frames))
|
||||
{
|
||||
thing1->collidedWith(thing2);
|
||||
}
|
||||
thing1=thing1->m_nextThing;
|
||||
}
|
||||
|
||||
// Player -> Hazard collision
|
||||
thing1=s_thingLists[CThing::TYPE_HAZARD];
|
||||
thing2=s_thingLists[CThing::TYPE_PLAYER];
|
||||
|
Loading…
Reference in New Issue
Block a user