Skip to content

[Bug] A fully engulfed diver can slide along inside a slab #131

Description

@N1k4G

Known residual from #129, recorded so it does not live only in a PR comment.

The behaviour

Once the diver's body is fully inside a structure, it can move along the structure at constant buried area — for example sliding the length of the vehicle-deck floor slab (x=14..78, d=39..40) without leaving it.

Why it is allowed

diverOverlapGrew() refuses any step that increases buried area. Escaping is always permitted, going deeper never is. But a fully engulfed diver sits on a flat gradient: every nearby step has identical buried area, so there is no strictly-reducing step to take. Equal-area movement has to be allowed or the diver is pinned in place with no way out — which is the stuck-diver bug the guard exists to prevent.

That allowance is what makes escape possible, and it is also what permits sliding.

Why it is minor

Only reachable from an already-anomalous overlap — a restored save, a site switch, or edited geometry. Normal play cannot produce a fully engulfed diver, because entering a structure is blocked at the boundary. The diver also cannot pass through to the far side of a slab in the direction that would bury it deeper; it can only travel along one.

Suggested fix

Resolve the overlap before physics resumes rather than trying to escape it during movement: on detecting an overlap at the start of a tick, push the diver to the nearest free position. Physics then never runs in an overlapping state, and the equal-area allowance can be dropped entirely — restoring a strict "only reducing" rule with no flat gradient to worry about.

That is a discontinuous position change, which is acceptable for the situations that produce it, and probably better than the diver swimming out of a wall in real time.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions