//handle end of floor section
if (linecheck == "<endfloor>" && config->RangeL == config->RangeH)
{
+ //when finishing a floor, make sure the altitude is valid
+ if (floor->AltitudeSet == false)
+ return ScriptError("Floor altitude or height has not been set");
+
config->SectionNum = 0;
config->Context = "None";
engine->Report("Finished floor");
InterfloorHeight = 0;
EnabledGroup = false;
EnabledGroup_Floor = 0;
+ AltitudeSet = false;
//create a dynamic mesh for doors
DoorWrapper = new DynamicMesh(this, GetSceneNode(), GetName() + " Door Container", 0, true);
//position object at altitude
SetPositionY(altitude);
Altitude = altitude;
+ AltitudeSet = true;
}
void Floor::ShowInfo(bool detailed, bool display_header)
std::vector<int> Group; //floor group
bool EnabledGroup; //true if floor was enabled as part of a group, not directly
int EnabledGroup_Floor; //number of floor that enabled this floor as part of it's own group
+ bool AltitudeSet; //has altitude been set?
//functions
Floor(Object *parent, FloorManager *manager, int number);