feat(ground-ai): return bot movement control on failure

Grant custom physics control per LocalMP bot and let the native layer release it when the script stops renewing control. Verified both TypeScript checks, the MSVC build, native resolution and check-patches on .37 and .58, and isolated .58 script loading.
This commit is contained in:
N0VAN0M4LY committed 2026-12-03 14:24:32 +08:00
1 parent bb680c6abd
commit 885e3bbb5d
15 files changed
+325 -63

No files matched your search

+5 -1
View File
@@ -130,7 +130,11 @@ export function buildGameCopy(inputs: GameCopyInputs): GameCopyBuild {
const executable = patchExecutableWithMods(inputs.stock.executable, folders.exe, enabledMods);
const stockImage = new PeImage(inputs.stock.executable);
const native = resolveNativeModules(stockImage, loadNativeModules(folders.native));
const customGroundDrive = groundAiActive && inputs.groundAi?.config.layers.navigation &&
inputs.groundAi.config.navigation.driveMode === 'vehicle_phys';
const nativeDefinitions = loadNativeModules(folders.native)
.filter((module) => customGroundDrive || module.module !== 'local_mp_ground_ai');
const native = resolveNativeModules(stockImage, nativeDefinitions);
const core = buildCorePacks(inputs, endpoint, folders.gui, enabledMods, packOverlays);
const executableFolder = dirname(GAME_FILES.executable);
@@ -51,6 +51,7 @@ export interface GroundAiConfig {
readonly maxPhysBots: number;
readonly steerSign: number;
readonly deadEchoSec: number;
readonly controlTimeoutSec: number;
readonly cornerBrakeAccel: number;
readonly pivotAngleDeg: number;
readonly stuckWindowSec: number;
@@ -148,6 +149,7 @@ function collectConfigEntries(c: GroundAiConfig): readonly DasEntry[] {
['WTO_AI_NAV_MAX_PHYS_BOTS', 'int', c.navigation.maxPhysBots],
['WTO_AI_NAV_STEER_SIGN', 'float', c.navigation.steerSign],
['WTO_AI_NAV_DEAD_ECHO_SEC', 'float', c.navigation.deadEchoSec],
['WTO_AI_NAV_CONTROL_TIMEOUT_SEC', 'float', c.navigation.controlTimeoutSec],
['WTO_AI_NAV_CORNER_BRAKE_ACCEL', 'float', c.navigation.cornerBrakeAccel],
['WTO_AI_NAV_PIVOT_ANGLE_DEG', 'float', c.navigation.pivotAngleDeg],
['WTO_AI_NAV_STUCK_WINDOW_SEC', 'float', c.navigation.stuckWindowSec],