Start ensuring cave (the global variable) is only used after generation