Skip to content

Item-loss path in _on_drop: failed Spawn silently drops the item #1

Description

@TechLuddite

Summary

In _on_drop, skip_super() is called first so vanilla never spawns a pickup. If inventoryGrid is null, or Spawn fails for both rotations, the function just returns. The item is neither on the ground nor in the grid — it is lost.

Steps to reproduce

  1. Trigger a drop where inventoryGrid is unavailable or Spawn fails (e.g. invalid rotation / blocked cell).
  2. Observe the item disappears instead of falling back to vanilla behavior.

Expected

  • Restore vanilla drop behavior on failure, or at least avoid consuming the item without a successful placement.

Suggested fix

  • Move skip_super() after successful placement, or add an explicit fallback path that calls the original drop logic.
  • Add basic tests for the failure cases.

Related issues:

— GrokLuddite on behalf of TechLuddite

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecurity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions