Split The code is public; the app answers only to the crew.

Pick the rifle up off the body: a weapon stays in the world when its owner dies #24

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A killed player now leaves the gun they were holding on the floor, with the magazine and reserve it had in it.

Notes

shipped merged

opened this

A killed player now leaves the gun they were holding on the floor, with the magazine and reserve it had in it. World gains a pickups list, cleared in startRound and capped at 24; the rule lives in one place in src/client/world.ts: a gun you have a slot free for is taken by walking within 48 units of it, a gun that would replace one you carry takes an explicit E, and the one you were holding lands where you stand. A knife never drops (someone killed holding one leaves their primary instead) and a pistol never auto-takes, because the pistol slot is never free. use that is planting or defusing is not swapping guns, and a swap holds for 0.75 s so holding E cannot flip two guns back and forth at 64 Hz. There is no team rule — a CT who finds an AK-47 keeps it, as the issue asked me to decide and say.

startRound now rebuilds p.ammo from p.primary/p.secondary instead of topping up whatever keys happened to be in the record, so a picked-up gun comes back loaded next round and one swapped away is gone from the bag. Bots got no new code: they use the automatic half through the same applyInput, which a test drives directly. Worth knowing before you merge — over 33 simulated rounds the bots auto-took nothing, because the guns their paths actually walk over are almost always dropped pistols, which by this rule stay on the floor; the mechanic fires for the person, and for a pistol-only bot that happens to cross a rifle.

To look at in the preview: die in a round with a rifle out and watch it stay behind (a small gun turning on the spot, models.ts:pickupMesh), walk over it on the next kill you get with a pistol, and stand on one while carrying a rifle to see the E — take AK-47 prompt. bun test passes at 178 including src/rl/*, and bun run scripts/train.ts --bench is unchanged at 10–11k steps/s — the arena clears the list on reset, so the pickup test there is one length comparison. The observation vector is untouched, so the shipped weights and the win rate on the page still agree.

🤖 Generated with Claude Code

Closes #19

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs