diff --git a/Graphics/levels/Chapter05/Level04/Level04.MEX b/Graphics/levels/Chapter05/Level04/Level04.MEX index 59b658107..4f0b0b9e4 100644 Binary files a/Graphics/levels/Chapter05/Level04/Level04.MEX and b/Graphics/levels/Chapter05/Level04/Level04.MEX differ diff --git a/Graphics/levels/Chapter05/Level04/Level04.Mep b/Graphics/levels/Chapter05/Level04/Level04.Mep index 680a5883f..682b37ea7 100644 Binary files a/Graphics/levels/Chapter05/Level04/Level04.Mep and b/Graphics/levels/Chapter05/Level04/Level04.Mep differ diff --git a/source/hazard/hazard.cpp b/source/hazard/hazard.cpp index d9b81bfca..d6a8bb2d2 100644 --- a/source/hazard/hazard.cpp +++ b/source/hazard/hazard.cpp @@ -553,11 +553,7 @@ void CNpcHazard::collidedWith( CThing *_thisThing ) break; } - case TYPE_NPC: - break; - default: - ASSERT(0); break; } } diff --git a/source/hazard/hbbarrel.cpp b/source/hazard/hbbarrel.cpp index 0f85299c3..863a559fa 100644 --- a/source/hazard/hbbarrel.cpp +++ b/source/hazard/hbbarrel.cpp @@ -239,11 +239,7 @@ void CNpcBouncingBarrelHazard::collidedWith( CThing *_thisThing ) break; } - case TYPE_NPC: - break; - default: - ASSERT(0); break; } } diff --git a/source/hazard/hboat.cpp b/source/hazard/hboat.cpp index b0eb2233e..adbe36f18 100644 --- a/source/hazard/hboat.cpp +++ b/source/hazard/hboat.cpp @@ -174,11 +174,7 @@ void CNpcBoatHazard::collidedWith( CThing *_thisThing ) break; } - case TYPE_NPC: - break; - default: - ASSERT(0); break; } } diff --git a/source/hazard/hbrock.cpp b/source/hazard/hbrock.cpp index d9f98a834..dd31b112d 100644 --- a/source/hazard/hbrock.cpp +++ b/source/hazard/hbrock.cpp @@ -224,11 +224,7 @@ void CNpcBouncingRockHazard::collidedWith( CThing *_thisThing ) break; } - case TYPE_NPC: - break; - default: - ASSERT(0); break; } } diff --git a/source/hazard/hfalling.cpp b/source/hazard/hfalling.cpp index b5c01c8df..ba18df390 100644 --- a/source/hazard/hfalling.cpp +++ b/source/hazard/hfalling.cpp @@ -223,11 +223,7 @@ void CNpcFallingHazard::collidedWith( CThing *_thisThing ) break; } - case TYPE_NPC: - break; - default: - ASSERT(0); break; } } diff --git a/source/hazard/hflytrap.cpp b/source/hazard/hflytrap.cpp index 0658fe6df..f788e30ae 100644 --- a/source/hazard/hflytrap.cpp +++ b/source/hazard/hflytrap.cpp @@ -181,11 +181,7 @@ void CNpcFlyTrapHazard::collidedWith( CThing *_thisThing ) break; } - case TYPE_NPC: - break; - default: - ASSERT(0); break; } } diff --git a/source/hazard/hpswitch.cpp b/source/hazard/hpswitch.cpp index b981322e4..06a888992 100644 --- a/source/hazard/hpswitch.cpp +++ b/source/hazard/hpswitch.cpp @@ -84,11 +84,7 @@ void CNpcPressureSwitchHazard::collidedWith( CThing *_thisThing ) break; } - case TYPE_NPC: - break; - default: - ASSERT(0); break; } } diff --git a/source/hazard/hrweight.cpp b/source/hazard/hrweight.cpp index 873200d61..37276ed15 100644 --- a/source/hazard/hrweight.cpp +++ b/source/hazard/hrweight.cpp @@ -268,7 +268,6 @@ void CNpcRisingWeightHazard::collidedWith( CThing *_thisThing ) } default: - ASSERT(0); break; } } diff --git a/source/hazard/hrwheel.cpp b/source/hazard/hrwheel.cpp index ca5f8b6d3..d1625218d 100644 --- a/source/hazard/hrwheel.cpp +++ b/source/hazard/hrwheel.cpp @@ -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; } } diff --git a/source/platform/prbridge.cpp b/source/platform/prbridge.cpp index c1ef1869b..af3d2c249 100644 --- a/source/platform/prbridge.cpp +++ b/source/platform/prbridge.cpp @@ -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 ); diff --git a/source/thing/thing.cpp b/source/thing/thing.cpp index e6e69f624..9de361307 100644 --- a/source/thing/thing.cpp +++ b/source/thing/thing.cpp @@ -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]; diff --git a/source/triggers/tplatfrm.cpp b/source/triggers/tplatfrm.cpp index a01bf6a68..23c0ac587 100644 --- a/source/triggers/tplatfrm.cpp +++ b/source/triggers/tplatfrm.cpp @@ -111,6 +111,14 @@ void CPlatformTrigger::collidedWith(CThing *_thisThing) break; } + case TYPE_PLAYERPROJECTILE: + { + m_platform->trigger(); + _thisThing->setToShutdown(); + + break; + } + default: break; }