Skip to content

p_ceilng: T_MoveCeiling silentCrushAndRaise missing speed-restore and direction-reverse #122

Description

@sunsided

Context

T_MoveCeiling in room/src/doom/p_ceilng.rs handles ceiling crushers.

C behavior

In the C switch(direction) case -1 (moving down) branch, the silentCrushAndRaise type:

  1. Plays the pstop sound
  2. Falls through to the crushAndRaise/fastCrushAndRaise handling, which:
    • Restores speed = CEILSPEED
    • Reverses direction to 1 (up)

This fallthrough is a C switch design pattern — the case for silentCrushAndRaise intentionally shares code with the crusher cases.

Rust behavior

The Rust port handles silentCrushAndRaise as a separate match arm that plays the sound but does NOT restore speed or reverse direction, diverging from the C fallthrough behavior.

Impact

Silent crusher ceilings may not correctly reverse after hitting the floor, potentially getting stuck or continuing to move down indefinitely.

Location

room/src/doom/p_ceilng.rs — T_MoveCeiling

Flagged with // FIXME: in the source.

Suggested fix

After playing the pstop sound for silentCrushAndRaise, add the same speed-restore and direction-reversal logic present in the crushAndRaise/fastCrushAndRaise arms.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kilo-duplicateAuto-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