Skip to content

p_ceilng: T_MoveCeiling direction-gate divergence from C #121

Description

@sunsided

Context

T_MoveCeiling in room/src/doom/p_ceilng.rs is the per-tic ceiling mover.

C behavior

The C original uses a switch(direction) with three branches:

  • case 0: stasis — no-op
  • case 1: moving up — calls T_MovePlane, handles pastdest/crushed for upward completion
  • case -1: moving down — calls T_MovePlane, handles pastdest/crushed for downward completion

The pastdest and crushed reactions are gated on direction so they only fire when moving in the matching direction.

Rust behavior

The Rust port passes direction to T_MovePlane correctly but the match-arm reactions for pastdest/crushed may not be properly gated on the current direction, potentially causing spurious firing when direction == 0 (stasis).

Impact

Ceiling movers in stasis could erroneously trigger sound/state-change logic.

Location

room/src/doom/p_ceilng.rsT_MoveCeiling

Flagged with // FIXME: in the source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-p_ceilngArea: p_ceilngbugSomething isn't workingkilo-auto-fixAuto-generated label by Kilokilo-triagedAuto-generated label by Kilo

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions