vehicles: a boat nobody rows is moored where it was called or left - its hull put back on the mooring (home_x, home_z, home_yaw) whenever it strays, and no wind on it; the wind drifts only a rowed boat

A called boat and one got out of drifted across the lake on the wind (the user's play of the bundle).
The tests hold a boat at its berth in a full wind for eight seconds, and one dropped out on the lake
where it was left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 12:12:44 +03:00
parent b2a45c2fda
commit 66da424b90
6 changed files with 64 additions and 13 deletions

View file

@ -39,8 +39,14 @@ function ve_put(v: Vehicle, x: float, z: float) -> void {
v.z = z
v.speed = 0.0
if v.kind == VEHICLE_BOAT { v.y = VehicleWorld.water(x, z) + 0.02 } else { v.y = VehicleWorld.ground(x, z) }
v.home_x = x
v.home_z = z
ve_moor(v)
}
# a boat nobody rows holds here (vehicles_tick); a horse is tied here
function ve_moor(v: Vehicle) -> void {
v.home_x = v.x
v.home_z = v.z
v.home_yaw = v.yaw
}
# Bring player pid's boat or horse to place k. False when the place is somebody else's, or it is
@ -59,8 +65,8 @@ export function vehicle_call_for(vehicles_st: VehiclesState, pid: int, kind: int
return true
}
if v.rider >= 0 { return false }
ve_put(v, vehicle_place_x(vehicles_st, kind, k), vehicle_place_z(vehicles_st, kind, k))
v.yaw = yaw
ve_put(v, vehicle_place_x(vehicles_st, kind, k), vehicle_place_z(vehicles_st, kind, k))
ve_settle(v)
VehicleWorld.placed(v)
return true