This commit is contained in:
Charles 2001-06-06 19:07:19 +00:00
parent e04f52731f
commit 9e55dc3eb2
2 changed files with 17 additions and 0 deletions

View File

@ -183,6 +183,7 @@ void CBasePickup::collidedWith(CThing *_thisThing)
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
case TYPE_NPC:
collect((CPlayer*)_thisThing);
CSoundMediator::playSfx(sfxToPlayWhenCollected());
break;

View File

@ -488,6 +488,22 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
thing1=thing1->m_nextCollisionThing;
}
// Friend -> Pickup collision
thing1=s_CollisionLists[CThing::TYPE_PICKUP];
while(thing1)
{
thing2=s_CollisionLists[CThing::TYPE_NPC];
while(thing2)
{
if(thing1->checkCollisionAgainst(thing2, _frames))
{
thing1->collidedWith(thing2);
}
thing2=thing2->m_nextCollisionThing;
}
thing1=thing1->m_nextCollisionThing;
}
// Player -> Enemy collision
thing1=s_CollisionLists[CThing::TYPE_ENEMY];
while(thing1)