Build independent base gameplay and source-bound native verification

This commit is contained in:
2026-09-19 08:09:14 +02:00
parent 16f397e581
commit af5146a317
580 changed files with 65780 additions and 107 deletions
+17
View File
@@ -0,0 +1,17 @@
from policy_harness import ROOT, body, run
import re
source = body(ROOT/'addons/core/Scripts/Game/ERR/ERR_CasualtyGroundSupport.c', 'static bool SupportHit(')
source = re.sub(r'(?<![\w.])(\d+\.\d+)(?![\w.])', r'\1f', source)
run('#include <cassert>\n' + source + '''
int main() {
assert(SupportHit(0,1,false,false));
assert(SupportHit(0.999,0.85,false,false));
assert(!SupportHit(1,1,false,false)); // no hit is no support
assert(!SupportHit(-0.01,1,false,false));
assert(!SupportHit(0.5,0.849,false,false));
assert(!SupportHit(0.5,-1,false,false));
assert(!SupportHit(0.5,1,true,false)); // own landing gear cannot support itself
assert(!SupportHit(0.5,1,false,true)); // player/vehicle is not static parking support
}
''')
print('PASS: actual short-cast hit, upward support normal, no self support and no dynamic support')