So, IsLockedByMaster doesn't appear to work, so I tried the method below, it seems to work fine for most doors on the auspices map, but the osprey map, doesn't appear to work on the SECURE ACCESS door to AREA 2. Seems to be caused when door is only activated by button and not by master. any ideas??
this is what I've got so far:
Code:
bool UTIL_DoorIsOpen ( CBaseDoor@ door, CBaseEntity@ pActivator )
{
string masterName = door.m_sMaster;
CBaseEntity@ pMaster = FIND_ENTITY_BY_TARGETNAME(null,masterName);
CBaseEntity@ pButton;
if ( pMaster !is null )
{
return pMaster.IsTriggered(pActivator);
}
// no master , find button
@pButton = FIND_ENTITY_BY_TARGET(null, door.pev.targetname );
if ( pButton !is null )
{
CBaseToggle@ pToggle = cast<CBaseToggle@>( pButton );
// something needed in here???
@pMaster = FIND_ENTITY_BY_TARGETNAME(null,pToggle.m_sMaster);
if ( pMaster !is null )
{
return pMaster.IsTriggered(pActivator);
}
return pButton.IsTriggered(pActivator);
}
// no master / no button
return door.IsTriggered(pActivator);
}
}