// // Restart a ceiling that's in-stasis // [RH] Passed a tag instead of a line and rewritten to use a list // void P_ActivateInStasisCeiling (int tag) { DCeiling *scan; TThinkerIterator<DCeiling> iterator; while ( (scan = iterator.Next ()) ) { if (scan->m_Tag == tag && scan->m_Direction == 0) { scan->m_Direction = scan->m_OldDirection; scan->PlayCeilingSound (); // [BC] If we're the server, tell clients to change the ceiling direction, and // play the ceiling sound. if ( NETWORK_GetState( ) == NETSTATE_SERVER ) { SERVERCOMMANDS_ChangeCeilingDirection( scan->GetID( ), scan->GetDirection( )); SERVERCOMMANDS_PlayCeilingSound( scan->GetID( )); } } } }
//***************************************************************************** // DCeiling *P_GetCeilingByID( LONG lID ) { DCeiling *pCeiling; TThinkerIterator<DCeiling> Iterator; while (( pCeiling = Iterator.Next( ))) { if ( pCeiling->GetID( ) == lID ) return ( pCeiling ); } return ( NULL ); }
// // EV_CeilingCrushStop // Stop a ceiling from crushing! // [RH] Passed a tag instead of a line and rewritten to use a list // bool EV_CeilingCrushStop (int tag) { bool rtn = false; DCeiling *scan; TThinkerIterator<DCeiling> iterator; while ( (scan = iterator.Next ()) ) { if (scan->m_Tag == tag && scan->m_Direction != 0) { // [BC] If we're stopping, this is probably a good time to verify all the clients // have the correct floor/ceiling height for this sector. if ( NETWORK_GetState( ) == NETSTATE_SERVER ) { if ( scan->m_Sector->floorOrCeiling == 0 ) SERVERCOMMANDS_SetSectorFloorPlane( ULONG( scan->m_Sector - sectors )); else SERVERCOMMANDS_SetSectorCeilingPlane( ULONG( scan->m_Sector - sectors )); // Tell clients to stop the floor's sound sequence. SERVERCOMMANDS_StopSectorSequence( scan->m_Sector ); } SN_StopSequence (scan->m_Sector); scan->m_OldDirection = scan->m_Direction; scan->m_Direction = 0; // in-stasis; rtn = true; // [BB] Also tell the updated direction to the clients. if ( NETWORK_GetState( ) == NETSTATE_SERVER ) SERVERCOMMANDS_ChangeCeilingDirection( scan->GetID( ), scan->GetDirection( )); } } return rtn; }