Skip to content

Make map-spawned knife entities respawn like other weapons (#163) - #315

Draft
darkshade9 wants to merge 4 commits into
aqtionfrom
feat/issue-163-feature-request-knife-spawns-behaves-lik
Draft

Make map-spawned knife entities respawn like other weapons (#163)#315
darkshade9 wants to merge 4 commits into
aqtionfrom
feat/issue-163-feature-request-knife-spawns-behaves-lik

Conversation

@darkshade9

Copy link
Copy Markdown

Summary

  • Map-placed weapon_knife entities now respawn after pickup using weapon_respawn timing, matching the behaviour of every other weapon pickup in the game.
  • Player-dropped knives are unchanged — they continue to follow the existing dropped-item lifecycle and do not become permanent map respawners.
  • The DF_WEAPONS_STAY DM flag is respected: when set, the knife entity gets FL_RESPAWN instead of a timed SetRespawn, exactly as grenades handle it.

Files modified

  • src/action/p_weapon.c — added 7 lines to the KNIFE_NUM pickup branch inside Pickup_Weapon

Verification

Step Command Result
Lint/build ninja -C builddir gamearm64.dylib ✅ pass — 0 new warnings (19 pre-existing in botlib, unrelated)
Smoke test tests/e2e/startup.spec.ts ⚠ skipped — spec not present in this repo
Tests no test runner detected ⚠ No test infrastructure; manual verification scenarios outlined in plan

Manual verification scenarios (per plan §4):

  1. Map-placed knife can be picked up; entity disappears immediately.
  2. Knife entity reappears after weapon_respawn seconds.
  3. Pickup fails cleanly when player is at knife_max; entity state unchanged.
  4. Player-dropped knives still clean up via the existing drop lifecycle.
  5. Grenade pickup behaviour unaffected.

Commit tier

Tier 2b (local unsigned commit + push) — repo does not enforce signed commits on aqtion.

Notes

  • Branch was created from master by the conductor (local origin/HEAD → master) but aqtion is the GitHub default branch. A merge commit bringing in origin/aqtion precedes the feature commit; this PR is targeted at aqtion.
  • g_items.c needed no changes — the SetRespawn / FL_RESPAWN machinery is already correct and shared.
  • Workspace mode: per-execute worktree at /Users/dino/Documents/git/q2pro/.prismconductor/worktrees/q2pro-163

Closes #163

darkshade9 and others added 4 commits January 30, 2023 15:09
Knife pickup entities placed in maps had no respawn scheduling after
being collected, making them one-shot pickups unlike every other weapon
in the game. This aligns the knife with grenade/weapon pickup semantics:
after pickup of a world-placed knife, the entity is hidden and scheduled
to reappear using weapon_respawn (matching the admin-configured interval
used by all other weapon pickups). Player-dropped knives are unaffected
and continue following the existing dropped-item lifecycle. The
DF_WEAPONS_STAY DM flag is respected exactly as it is for grenades.

Closes #163

Co-Authored-By: PrismConductor worker <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Knife spawns/behaves like grenade

1 participant