This commit is contained in:
Charles 2001-07-30 19:43:39 +00:00
parent 469a744a87
commit 64012414b9
14 changed files with 50 additions and 33 deletions

View File

@ -553,11 +553,7 @@ void CNpcHazard::collidedWith( CThing *_thisThing )
break;
}
case TYPE_NPC:
break;
default:
ASSERT(0);
break;
}
}

View File

@ -239,11 +239,7 @@ void CNpcBouncingBarrelHazard::collidedWith( CThing *_thisThing )
break;
}
case TYPE_NPC:
break;
default:
ASSERT(0);
break;
}
}

View File

@ -174,11 +174,7 @@ void CNpcBoatHazard::collidedWith( CThing *_thisThing )
break;
}
case TYPE_NPC:
break;
default:
ASSERT(0);
break;
}
}

View File

@ -224,11 +224,7 @@ void CNpcBouncingRockHazard::collidedWith( CThing *_thisThing )
break;
}
case TYPE_NPC:
break;
default:
ASSERT(0);
break;
}
}

View File

@ -223,11 +223,7 @@ void CNpcFallingHazard::collidedWith( CThing *_thisThing )
break;
}
case TYPE_NPC:
break;
default:
ASSERT(0);
break;
}
}

View File

@ -181,11 +181,7 @@ void CNpcFlyTrapHazard::collidedWith( CThing *_thisThing )
break;
}
case TYPE_NPC:
break;
default:
ASSERT(0);
break;
}
}

View File

@ -84,11 +84,7 @@ void CNpcPressureSwitchHazard::collidedWith( CThing *_thisThing )
break;
}
case TYPE_NPC:
break;
default:
ASSERT(0);
break;
}
}

View File

@ -268,7 +268,6 @@ void CNpcRisingWeightHazard::collidedWith( CThing *_thisThing )
}
default:
ASSERT(0);
break;
}
}

View File

@ -94,11 +94,17 @@ void CNpcRisingWeightWheelHazard::collidedWith( CThing *_thisThing )
break;
}
case TYPE_NPC:
break;
case TYPE_PLAYERPROJECTILE:
{
m_weight->setTriggered();
m_rotation += 128;
m_rotation &= 4095;
_thisThing->setToShutdown();
}
default:
ASSERT(0);
break;
}
}

View File

@ -87,7 +87,7 @@ void CNpcRisingBridgePlatform::setWaypoints( sThingPlatform *ThisPlatform )
// trigger = new ("PlatformTrigger") CPlatformTrigger();
trigger=(CPlatformTrigger*)CTrigger::Create(CTrigger::TRIGGER_PLATFORM);
trigger->setPositionAndSize( ( newXPos << 4 ) + 8, ( newYPos << 4 ) + 16, 100, 0 );
trigger->setPositionAndSize( ( newXPos << 4 ) + 8 - 20, ( newYPos << 4 ) + 16 - 20, 40, 40 );
//trigger->setTargetBox(TriggerList->TargetPos.X<<4,TriggerList->TargetPos.Y<<4,TriggerList->TargetSize.X<<4,TriggerList->TargetSize.Y<<4);
trigger->setPlatform( this );

View File

@ -724,6 +724,38 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
thing1=thing1->m_nextCollisionThing;
}
// Trigger -> Player projectile collision
thing1=s_CollisionLists[CThing::TYPE_PLAYERPROJECTILE];
while(thing1)
{
thing2=s_CollisionLists[CThing::TYPE_TRIGGER];
while(thing2)
{
if(thing1->checkCollisionAgainst(thing2, _frames))
{
thing2->collidedWith(thing1);
}
thing2=thing2->m_nextCollisionThing;
}
thing1=thing1->m_nextCollisionThing;
}
// Hazard -> Player projectile collision
thing1=s_CollisionLists[CThing::TYPE_PLAYERPROJECTILE];
while(thing1)
{
thing2=s_CollisionLists[CThing::TYPE_HAZARD];
while(thing2)
{
if(thing1->checkCollisionAgainst(thing2, _frames))
{
thing2->collidedWith(thing1);
}
thing2=thing2->m_nextCollisionThing;
}
thing1=thing1->m_nextCollisionThing;
}
// Friendly npc -> Platform projectile collision - first clear platforms
CNpcFriend *friendNpc = (CNpcFriend *) s_CollisionLists[CThing::TYPE_NPC];

View File

@ -111,6 +111,14 @@ void CPlatformTrigger::collidedWith(CThing *_thisThing)
break;
}
case TYPE_PLAYERPROJECTILE:
{
m_platform->trigger();
_thisThing->setToShutdown();
break;
}
default:
break;
}