from pathlib import Path from policy_harness import body,run ROOT=Path(__file__).resolve().parents[1] s=body(ROOT/'addons/core/Scripts/Game/ERR/10_AI/ERR_HelicopterAvailability.c','string Check(') run('#include \n#include \nusing std::string;\nstruct Availability {float m_fGroundedSince=-1;\n'+s+'''}; int main(){ Availability a; assert(a.Check(0,0,false,false,true,false,false,0,0).empty()); assert(!a.Check(0,0,true,false,true,false,false,0,0).empty()); assert(a.Check(20000,0,false,false,true,false,false,0,0).empty()); assert(a.Check(79999,0,false,false,true,false,false,0,0).empty()); assert(!a.Check(80000,0,false,false,true,false,false,0,0).empty()); assert(a.Check(81000,0,false,false,true,true,false,0,0).empty()); assert(a.Check(82000,0,false,false,true,false,true,0,0).empty()); assert(!a.Check(82000,0,false,true,true,false,false,0,0).empty()); assert(!a.Check(82000,0,false,false,false,false,false,0,0).empty()); } ''') print('PASS: migrated aircraft availability policy (controller migration still pending)')