Assuming there is a return dMetalFrameR;
at the end of that function, then the result is always 0.0
because that variable is never changed from its initial value.
This, incorrect, code:
double dMetalFrameR = 0.0;if (m_dMetalDoorK) double dMetalFrameR = m_dMetalDoorX / m_dMetalDoorK;
Creates a new variable with the same name and then discards it when the if
statement goes out-of-scope.