@@ -2059,18 +2059,9 @@ void W3DModelDraw::Set_Model_State(ModelConditionInfo const *new_state)
2059
2059
#endif
2060
2060
2061
2061
const ModelConditionInfo *next = nullptr ;
2062
- <<<<<<< Updated upstream
2063
2062
2064
2063
if (m_curState != nullptr && new_state != nullptr ) { // if both states exist
2065
2064
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
2074
2065
#ifdef GAME_DEBUG_STRUCTS
2075
2066
if (Get_Drawable () != nullptr ) {
2076
2067
if (Get_Drawable ()->Get_Object () != nullptr ) {
@@ -2084,10 +2075,9 @@ void W3DModelDraw::Set_Model_State(ModelConditionInfo const *new_state)
2084
2075
}
2085
2076
#endif
2086
2077
2087
- // return early becasue state is not changing
2088
2078
return ;
2089
2079
}
2090
- // new state allows animation to finish
2080
+
2091
2081
if (new_state != m_curState && new_state->m_allowToFinishKey != NAMEKEY_INVALID
2092
2082
&& new_state->m_allowToFinishKey == m_curState->m_transitionKey && m_renderObject != nullptr
2093
2083
&& !Is_Animation_Complete (m_renderObject)) {
@@ -2106,15 +2096,12 @@ void W3DModelDraw::Set_Model_State(ModelConditionInfo const *new_state)
2106
2096
2107
2097
m_nextState = new_state;
2108
2098
m_loopDuration = -1 ;
2109
- // return early to allow animation to finish
2110
2099
return ;
2111
2100
}
2112
- // unnecessary condition
2101
+
2113
2102
if (new_state != m_curState) {
2114
- // if both states are animations
2115
2103
if (m_curState->m_transitionKey != NAMEKEY_INVALID) {
2116
2104
if (new_state->m_transitionKey != NAMEKEY_INVALID) {
2117
- // ^both ifs can be merged with &&
2118
2105
const ModelConditionInfo *state =
2119
2106
Find_Transition_For_Sig (Make_Transition (m_curState->m_transitionKey , new_state->m_transitionKey ));
2120
2107
@@ -2148,10 +2135,9 @@ void W3DModelDraw::Set_Model_State(ModelConditionInfo const *new_state)
2148
2135
2149
2136
Stop_Client_Particle_Systems ();
2150
2137
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)) {
2155
2141
Matrix3D tm ;
2156
2142
Nuke_Current_Render (&tm );
2157
2143
Drawable *drawable = Get_Drawable ();
0 commit comments