[PR #4299] [CLOSED] Offline skin and cape come back after a resource reload too #5548

Closed
opened 2026-11-03 05:13:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4299
Author: @GIGABAIT93
Created: 10/30/2026
Status: ❌ Closed

Base: main ← Head: fix/skins-after-pack-reload


📝 Commits (2)

  • 611d254 Skins come back after a resource reload
  • 5e16873 Merge main; the offline skin and cape come back after a reload too

📊 Changes

1 file changed (+13 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+13 -7)

📄 Description

🤖 Opened by GIGABAIT93's AI agent (Claude Code, Claude Opus 5.5), not by GIGABAIT93 directly.

Update (after merging main)

#4108 landed on main at 20:23 UTC with the same again_skin condition, so downloaded skins and capes now come back after a reload on main too. What this PR still adds is the same rule for the offline skin and offline cape. They were stored only when their slot was missing, so after a reload they stayed gone until restart (found in review by DUzzL's agent). skin_in_atlas (slot and sprite) now decides for all three, so the PR is one file, +13 −7, in game/remote.rs. The cause analysis and proof below are from before the merge and still describe the shared bug.

What

After a resource reload, skins that were already downloaded draw nothing: your own body, other players and NPCs disappear, and the first-person arm is untextured. A reload happens when a server's resource pack loads on join, when the next server sends its pack, and on F3+T. GIGABAIT93 hit it on tensa.co.ua, which sends a pack. The skin is in the disk cache, so it reaches the atlas before the pack does. Their own skin was gone from the inventory preview, and so was an NPC that wears the same skin. This may also be the cause of #4096 ("Server invisible skin error", reported on two servers), which #4108 works around without a reproduction.

Cause. apply_staged_pack swaps in a new UiResources (self.gui = gui), so the GUI atlas is rebuilt from the packs. The sprites store_skin had added for the skin slots (skins/<hash>, capes/<hash>) are gone, but skin_slots still lists them. again_skin only asked skin_slots, so it said each skin was in the atlas. drawn_skin then gave the player, the other players, mannequins and capes a sprite name that the atlas no longer has, and render_with draws no body for it.

Fix. again_skin also checks that the sprite is in the atlas. If it isn't, the image is queued again (Downloader::again keeps it, or reads it from the cache), store_skin puts it back into the slot it already holds, and the default skin is drawn for the frame in between. This is the same path a skin takes when its slot was taken. The change is one condition in game/remote.rs.

No unit test: again_skin and the reload are on Game, and the client has no Game test fixture. The proof below drives the real path: the server's pack on join, and F3+T.

Proof (Windows 11, tensa.co.ua)

Same account and spot, --offscreen, driven by horizon-ctl. The game joins and waits 45 s for the server's pack, then takes a first-person shot and a third-person shot (F5). Then it presses F3+T, waits 30 s and takes the shots again.

  • before: nightly-2026-10-30-fbd7288;
  • after: this branch at 611d2547f (same main, plus this change).
before after
joined (third person)
joined (first person)
after F3+T (third person)

Before, right after joining, the player has no body in third person, the arm is a flat untextured block, and the NPC in the middle (it wears the player's skin) is missing. After F3+T, every NPC whose skin was already loaded disappears. After, the player, the cape and every NPC are drawn, both on join and after F3+T.

pr_ready (tools/pr_ready.py --quick --base upstream/main on GIGABAIT, against upstream/main at 45982faa5, 3 min 45 s)

Check Result
Scope ✅ 1 files, +4 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (29 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 19 s)
tests: horizon-client ✅ 972 passed (1 min 48 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4299 **Author:** [@GIGABAIT93](https://github.com/GIGABAIT93) **Created:** 10/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/skins-after-pack-reload` --- ### 📝 Commits (2) - [`611d254`](https://github.com/horizon-rust/horizon/commit/611d2547f84589e9b3162a0103011a1cfa8b7974) Skins come back after a resource reload - [`5e16873`](https://github.com/horizon-rust/horizon/commit/5e168735177e9f73597a1d7521cccf927f3e040b) Merge main; the offline skin and cape come back after a reload too ### 📊 Changes **1 file changed** (+13 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+13 -7) </details> ### 📄 Description > 🤖 Opened by GIGABAIT93's AI agent (Claude Code, Claude Opus 5.5), not by GIGABAIT93 directly. ## Update (after merging main) #4108 landed on main at 20:23 UTC with the same `again_skin` condition, so downloaded skins and capes now come back after a reload on main too. What this PR still adds is the same rule for the **offline skin and offline cape**. They were stored only when their slot was missing, so after a reload they stayed gone until restart (found in review by DUzzL's agent). `skin_in_atlas` (slot and sprite) now decides for all three, so the PR is one file, +13 −7, in `game/remote.rs`. The cause analysis and proof below are from before the merge and still describe the shared bug. ## What After a resource reload, skins that were already downloaded draw nothing: your own body, other players and NPCs disappear, and the first-person arm is untextured. A reload happens when a server's resource pack loads on join, when the next server sends its pack, and on F3+T. GIGABAIT93 hit it on tensa.co.ua, which sends a pack. The skin is in the disk cache, so it reaches the atlas before the pack does. Their own skin was gone from the inventory preview, and so was an NPC that wears the same skin. This may also be the cause of #4096 ("Server invisible skin error", reported on two servers), which #4108 works around without a reproduction. **Cause.** `apply_staged_pack` swaps in a new `UiResources` (`self.gui = gui`), so the GUI atlas is rebuilt from the packs. The sprites `store_skin` had added for the skin slots (`skins/<hash>`, `capes/<hash>`) are gone, but `skin_slots` still lists them. `again_skin` only asked `skin_slots`, so it said each skin was in the atlas. `drawn_skin` then gave the player, the other players, mannequins and capes a sprite name that the atlas no longer has, and `render_with` draws no body for it. **Fix.** `again_skin` also checks that the sprite is in the atlas. If it isn't, the image is queued again (`Downloader::again` keeps it, or reads it from the cache), `store_skin` puts it back into the slot it already holds, and the default skin is drawn for the frame in between. This is the same path a skin takes when its slot was taken. The change is one condition in `game/remote.rs`. No unit test: `again_skin` and the reload are on `Game`, and the client has no `Game` test fixture. The proof below drives the real path: the server's pack on join, and F3+T. ## Proof (Windows 11, tensa.co.ua) Same account and spot, `--offscreen`, driven by `horizon-ctl`. The game joins and waits 45 s for the server's pack, then takes a first-person shot and a third-person shot (F5). Then it presses F3+T, waits 30 s and takes the shots again. - **before:** `nightly-2026-10-30-fbd7288`; - **after:** this branch at `611d2547f` (same main, plus this change). | | before | after | | --- | --- | --- | | joined (third person) | ![](https://github.com/GIGABAIT93/horizon/releases/download/proof-skins-reload/joined-before.png) | ![](https://github.com/GIGABAIT93/horizon/releases/download/proof-skins-reload/joined-after.png) | | joined (first person) | ![](https://github.com/GIGABAIT93/horizon/releases/download/proof-skins-reload/arm-before.png) | ![](https://github.com/GIGABAIT93/horizon/releases/download/proof-skins-reload/arm-after.png) | | after F3+T (third person) | ![](https://github.com/GIGABAIT93/horizon/releases/download/proof-skins-reload/reload-before.png) | ![](https://github.com/GIGABAIT93/horizon/releases/download/proof-skins-reload/reload-after.png) | Before, right after joining, the player has no body in third person, the arm is a flat untextured block, and the NPC in the middle (it wears the player's skin) is missing. After F3+T, every NPC whose skin was already loaded disappears. After, the player, the cape and every NPC are drawn, both on join and after F3+T. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on GIGABAIT, against upstream/main at 45982faa5, 3 min 45 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +4 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (29 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 19 s) | | tests: horizon-client | ✅ 972 passed (1 min 48 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:20 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5548
No description provided.