This commit is contained in:
Charles 2001-05-25 20:00:13 +00:00
parent 1d62c1aa7e
commit a17ebb002a
4 changed files with 50 additions and 24 deletions

View file

@ -169,12 +169,10 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
CNpcPlatform *CNpcPlatform::Create(int Type)
{
CNpcPlatform *platform;
NPC_PLATFORM_UNIT_TYPE Type = getTypeFromMapEdit( ThisPlatform->Type );
platform = (CNpcPlatform*)CThingManager::GetThing(CThing::TYPE_PLATFORM,Type);
if (!platform)
switch( Type )
@ -182,7 +180,6 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
case NPC_LINEAR_PLATFORM:
{
platform = new ("linear platform") CNpcLinearPlatform;
break;
}
@ -268,19 +265,7 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
case NPC_DUAL_PLATFORM:
{
CNpcDualPlatform *dualPlatformMaster;
platform = dualPlatformMaster = new ("dual platform master") CNpcDualPlatform;
dualPlatformMaster->setMaster( true );
CNpcDualPlatform *dualPlatformSlave;
dualPlatformSlave = new ("dual platform slave") CNpcDualPlatform;
dualPlatformSlave->setMaster( false );
dualPlatformMaster->setOtherPlatform( dualPlatformSlave );
dualPlatformSlave->setOtherPlatform( dualPlatformMaster );
dualPlatformSlave->setType( Type );
dualPlatformSlave->setGraphic( ThisPlatform );
dualPlatformSlave->setTiltable( false );
platform = new ("dual platform master") CNpcDualPlatform;
break;
}
@ -389,12 +374,8 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
}
ASSERT(platform);
platform->setType( Type );
platform->setType( (NPC_PLATFORM_UNIT_TYPE) Type );
platform->setThingSubType( Type );
platform->setGraphic( ThisPlatform );
platform->setWaypoints( ThisPlatform );
platform->setTiltable( false );
return( platform );
@ -402,6 +383,48 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
{
CNpcPlatform *platform;
NPC_PLATFORM_UNIT_TYPE Type = getTypeFromMapEdit( ThisPlatform->Type );
platform=Create(Type);
switch( Type )
{
case NPC_DUAL_PLATFORM:
{
CNpcDualPlatform *dualPlatformMaster = (CNpcDualPlatform *) platform;
dualPlatformMaster->setMaster( true );
CNpcDualPlatform *dualPlatformSlave;
dualPlatformSlave = (CNpcDualPlatform *) CNpcPlatform::Create( NPC_DUAL_PLATFORM );
dualPlatformSlave->setMaster( false );
dualPlatformSlave->setType( Type );
dualPlatformSlave->setGraphic( ThisPlatform );
dualPlatformSlave->setTiltable( false );
dualPlatformMaster->setOtherPlatform( dualPlatformSlave );
dualPlatformSlave->setOtherPlatform( dualPlatformMaster );
break;
}
default:
break;
}
ASSERT(platform);
platform->setGraphic( ThisPlatform );
platform->setWaypoints( ThisPlatform );
return( platform );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPlatform::setWaypoints( sThingPlatform *ThisPlatform )
{
int pointNum;