MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / SwitchState

Method SwitchState

ogsr_engine/xrGame/ElevatorState.cpp:99–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97const char* dbg_state[] = {"clbNone", "clbNearUp", "clbNearDown", "clbClimbingUp", "clbClimbingDown", "clbDepart", "clbNoLadder"};
98#endif
99void CElevatorState::SwitchState(Estate new_state)
100{
101 if (!StateSwitchInertion(new_state))
102 return;
103#ifdef DEBUG
104 if (ph_dbg_draw_mask.test(phDbgLadder))
105 Msg("%s", dbg_state[new_state]);
106#endif
107 VERIFY(m_character);
108 if ((m_state != clbClimbingUp && m_state != clbClimbingDown) && (new_state == clbClimbingUp || new_state == clbClimbingDown))
109 dBodySetGravityMode(m_character->get_body(), 0);
110
111 if ((new_state != clbClimbingUp && new_state != clbClimbingDown) && (m_state == clbClimbingUp || m_state == clbClimbingDown))
112 dBodySetGravityMode(m_character->get_body(), 1);
113
114 // if(new_state==clbDepart) InitDepart();
115 NewState();
116 m_state = new_state;
117}
118void CElevatorState::UpdateStNone()
119{
120 VERIFY(m_ladder && m_character);

Callers

nothing calls this directly

Calls 4

MsgFunction · 0.85
dBodySetGravityModeFunction · 0.85
testMethod · 0.45
get_bodyMethod · 0.45

Tested by

no test coverage detected