This commit is contained in:
Charles 2001-05-23 23:16:43 +00:00
parent ec8ff7ed5b
commit 396949c907
13 changed files with 142 additions and 6 deletions

View file

@ -43,6 +43,10 @@
#include "hazard\hrwheel.h"
#endif
#ifndef __HAZARD_HPSWITCH_H__
#include "hazard\hpswitch.h"
#endif
/* Std Lib
------- */
@ -189,6 +193,53 @@ void CThingManager::initAllThings()
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CThingManager::matchPressureSwitches()
{
CNpcHazard *hazard;
hazard = (CNpcHazard *) s_thingLists[CThing::TYPE_HAZARD];
while( hazard )
{
if ( hazard->getType() == CNpcHazard::NPC_PRESSURE_SWITCH_HAZARD )
{
CNpcPressureSwitchHazard *switchHazard = (CNpcPressureSwitchHazard *) hazard;
DVECTOR triggerPos = switchHazard->getTriggerPos();
CNpcPlatform *platform;
platform = (CNpcPlatform *) s_thingLists[CThing::TYPE_PLATFORM];
while( platform )
{
if ( platform->getType() == CNpcPlatform::NPC_TRAPDOOR_PLATFORM )
{
CNpcTrapdoorPlatform *trapdoor = (CNpcTrapdoorPlatform *) platform;
DVECTOR testPos = trapdoor->getTriggerPos();
if ( testPos.vx == triggerPos.vx && testPos.vy == triggerPos.vy )
{
switchHazard->linkToPlatform( trapdoor );
}
}
platform = (CNpcPlatform *) platform->m_nextListThing;
}
}
hazard = (CNpcHazard *) hazard->m_nextListThing;
}
}
/*----------------------------------------------------------------------
Function:
Purpose: