@@ -2059,18 +2059,9 @@ void W3DModelDraw::Set_Model_State(ModelConditionInfo const *new_state)
20592059#endif
20602060
20612061 const ModelConditionInfo *next = nullptr ;
2062- <<<<<<< Updated upstream
20632062
20642063 if (m_curState != nullptr && new_state != nullptr ) { // if both states exist
20652064 if (m_nextState == new_state) {
2066- =======
2067- // if both states exist
2068- if (m_curState != nullptr && new_state != nullptr ) {
2069- // ^first condition is unnecessary
2070- // if both states are equal
2071- if (m_curState == new_state && m_nextState == nullptr || m_curState != nullptr && m_nextState == new_state) {
2072- // ^single m_curState == new_state is sufficient
2073- >>>>>>> Stashed changes
20742065#ifdef GAME_DEBUG_STRUCTS
20752066 if (Get_Drawable () != nullptr ) {
20762067 if (Get_Drawable ()->Get_Object () != nullptr ) {
@@ -2084,10 +2075,9 @@ void W3DModelDraw::Set_Model_State(ModelConditionInfo const *new_state)
20842075 }
20852076#endif
20862077
2087- // return early becasue state is not changing
20882078 return ;
20892079 }
2090- // new state allows animation to finish
2080+
20912081 if (new_state != m_curState && new_state->m_allowToFinishKey != NAMEKEY_INVALID
20922082 && new_state->m_allowToFinishKey == m_curState->m_transitionKey && m_renderObject != nullptr
20932083 && !Is_Animation_Complete (m_renderObject)) {
@@ -2106,15 +2096,12 @@ void W3DModelDraw::Set_Model_State(ModelConditionInfo const *new_state)
21062096
21072097 m_nextState = new_state;
21082098 m_loopDuration = -1 ;
2109- // return early to allow animation to finish
21102099 return ;
21112100 }
2112- // unnecessary condition
2101+
21132102 if (new_state != m_curState) {
2114- // if both states are animations
21152103 if (m_curState->m_transitionKey != NAMEKEY_INVALID) {
21162104 if (new_state->m_transitionKey != NAMEKEY_INVALID) {
2117- // ^both ifs can be merged with &&
21182105 const ModelConditionInfo *state =
21192106 Find_Transition_For_Sig (Make_Transition (m_curState->m_transitionKey , new_state->m_transitionKey ));
21202107
@@ -2148,10 +2135,9 @@ void W3DModelDraw::Set_Model_State(ModelConditionInfo const *new_state)
21482135
21492136 Stop_Client_Particle_Systems ();
21502137 Hide_All_Muzzle_Flashes (new_state, m_renderObject);
2151- // if model gains initial state || model changes || turret changes
2152-
2153- if (m_curState == nullptr || new_state->m_modelName != m_curState->m_modelName
2154- || Turret_Names_Differ (new_state, m_curState)) {
2138+
2139+ if (m_curState == nullptr || new_state->m_modelName != m_curState->m_modelName
2140+ || Turret_Names_Differ (new_state, m_curState)) {
21552141 Matrix3D tm;
21562142 Nuke_Current_Render (&tm);
21572143 Drawable *drawable = Get_Drawable ();
0 commit comments