I've greatly simplified this question as the same problem arises in a simpler case:
#include <iostream>
int height;
int main()
{
std::cout << height; // Visual Studio debugger shows this value as -858993460
int height;
}
Seems a problem with the debugger displaying the wrong variable value. The variable value is correct, as printing the variable shows the correct global height value, 0.