Fix low-terrain startup and extraction placement; record Workshop 0.0.121
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-10-25 14:01:49 +01:00
parent 3768ce7ed8
commit 6397fe89b6
18 changed files with 211 additions and 38 deletions
+5 -5
View File
@@ -156,12 +156,12 @@ namespace Math {
float Min(float a,float b){return a<b?a:b;}float Clamp(float v,float lo,float hi){return v<lo?lo:(v>hi?hi:v);}
float Cos(float a){return std::cos(a);}float Sin(float a){return std::sin(a);}
}
namespace ERR_Actors {vector Ground(vector p){return p;}}
namespace ERR_Actors {vector Ground(vector p){p[1]=42.5;return p;}}
namespace ERR_CampTerrain {vector Rotate(vector p,float){return p;}}
namespace ERR_AirfieldPlacement {
bool airfield=false,ground=true;int airportChecks=0,groundChecks=0;
bool Clear(vector){airportChecks++;return airfield;}
bool ClearGround(vector){groundChecks++;return ground;}
bool Clear(vector p){assert(p[1]==42.5);airportChecks++;return airfield;}
bool ClearGround(vector p){assert(p[1]==42.5);groundChecks++;return ground;}
}
namespace ERR_RescueLanding {bool fits=true;int checks=0;bool Fits(vector){checks++;return fits;}}
template<class T>struct Array:std::vector<T>{bool IsEmpty(){return this->empty();}int Count(){return this->size();}};
@@ -196,7 +196,7 @@ int main(){
site.Kind=Kind::PRISON;p=s.SamplePosition(&site);assert(p[0]==5000&&p[2]==-1000&&Math::indexed==1);
site.Kind=Kind::EXTRACTION;site.RequireAirfield=false;
p=s.SamplePosition(&site);assert(p[0]==5000&&p[2]==-1000&&Math::indexed==1);
assert(s.Survey(&site,p,0,floor)&&floor==42);assert(ERR_AirfieldPlacement::groundChecks==1&&ERR_AirfieldPlacement::airportChecks==0&&s.m_Terrain.airportBuffer==1200);
assert(s.Survey(&site,p,0,floor)&&floor==42.5);assert(ERR_AirfieldPlacement::groundChecks==1&&ERR_AirfieldPlacement::airportChecks==0&&s.m_Terrain.airportBuffer==1200);
ERR_AirfieldPlacement::ground=false;assert(!s.Survey(&site,p,0,floor)&&s.m_PadRejected==1);
site.RequireAirfield=true;ERR_AirfieldPlacement::ground=true;
assert(!s.Survey(&site,p,0,floor));assert(ERR_AirfieldPlacement::airportChecks==1&&ERR_AirfieldPlacement::groundChecks==2);
@@ -210,7 +210,7 @@ int main(){
int rejected=s.m_PadRejected;assert(!s.Survey(&site,p,0,floor)&&s.m_PadRejected==rejected+1);
ERR_RescueLanding::fits=true;assert(s.Survey(&site,p,0,floor));
site.Kind=Kind::PRISON;ERR_RescueLanding::fits=false;int fleetChecks=ERR_RescueLanding::checks;
assert(s.Survey(&site,p,0,floor)&&ERR_RescueLanding::checks==fleetChecks);
assert(s.Survey(&site,p,0,floor)&&floor==42&&ERR_RescueLanding::checks==fleetChecks);
}
''')
print('PASS: real sampling handles absent airports and extraction clearance preserves geometry/navigation/flatness while selecting the correct aircraft survey')