This commit is contained in:
parent
b061d250d6
commit
5e15b2b759
3 changed files with 39 additions and 0 deletions
|
@ -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()
|
void CNpcFriend::startConderversation()
|
||||||
{
|
{
|
||||||
// I am 'avin a fayg
|
// I am 'avin a fayg
|
||||||
|
|
|
@ -76,6 +76,8 @@ protected:
|
||||||
|
|
||||||
void startConderversation();
|
void startConderversation();
|
||||||
|
|
||||||
|
virtual void collidedWith(CThing *_thisThing);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
EXTEND_RIGHT = true,
|
EXTEND_RIGHT = true,
|
||||||
|
|
|
@ -171,6 +171,19 @@ void CThingManager::thinkAllThings(int _frames)
|
||||||
thing1=thing1->m_nextThing;
|
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
|
// Player -> Hazard collision
|
||||||
thing1=s_thingLists[CThing::TYPE_HAZARD];
|
thing1=s_thingLists[CThing::TYPE_HAZARD];
|
||||||
thing2=s_thingLists[CThing::TYPE_PLAYER];
|
thing2=s_thingLists[CThing::TYPE_PLAYER];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue