Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3213,12 +3213,19 @@ void W3DModelDraw::replaceIndicatorColor(Color color)
{
m_hexColor = newColor;

// set these to nullptr to force a regen of everything in setModelState.
const ModelConditionInfo* tmp = m_curState;
m_curState = nullptr;
m_nextState = nullptr;
m_nextStateAnimLoopDuration = NO_NEXT_DURATION;
setModelState(tmp);
// TheSuperHackers @bugfix Do not call setModelState with a null state pointer, as this
// can happen when replaceIndicatorColor is called before the draw module has been fully
// initialized (e.g. during object creation in friend_bindToObject). In such cases, the
// updated m_hexColor will be picked up on the next proper setModelState call.
if (m_curState != nullptr)
{
// set these to nullptr to force a regen of everything in setModelState.
const ModelConditionInfo* tmp = m_curState;
m_curState = nullptr;
m_nextState = nullptr;
m_nextStateAnimLoopDuration = NO_NEXT_DURATION;
setModelState(tmp);
}
}
}
}
Expand Down
Loading