[PR #7541] Pack the mod image slot when the build has mods, not when trait mods exist #7658

Open
opened 2026-11-03 07:21:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7541
Author: @Domanffe
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/native-mod-image-in-built


📝 Commits (1)

  • 3fe3bca Ask the build, not the trait mods, whether a mod image slot is needed

📊 Changes

3 files changed (+29 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -1)
📝 crates/horizon-client/src/game/mods.rs (+27 -0)
📝 crates/horizon-client/src/game/packs.rs (+1 -1)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

#7149 packed the mod image slot only when mod_api::mods() was not empty. That list is the harness's trait mods, and a native mod built from mixins is not one: it runs through its injections, so the list stays empty and the slot was never packed. A world map mod that draws into it got false from native_mod_image and native_sprite found no sprite — the map stayed black.

This reads the build instead: the launcher writes native-mods.json beside the executable for a game it built with mods (BUILD_INFO, already used for the crash report and the not-built rows), and a release or Nightly has no such file.

  • mods::built_with_native_mods(): current_exe()'s native-mods.json, mods list non-empty.
  • game.rs and game/packs.rs pass that instead of !mod_api::mods().is_empty().
  • One unit test pins the parse: empty, {}, an empty list, a non-list and a listed mod.

Seen on a local build of this branch with a world map native mod: the map draws, where before the slot was missing. Without a mod built in, nothing changes.

The pr_ready block follows as a comment.


🔄 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/7541 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/native-mod-image-in-built` --- ### 📝 Commits (1) - [`3fe3bca`](https://github.com/horizon-rust/horizon/commit/3fe3bcaf4705df0a38b0510ddb99807556684e46) Ask the build, not the trait mods, whether a mod image slot is needed ### 📊 Changes **3 files changed** (+29 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -1) 📝 `crates/horizon-client/src/game/mods.rs` (+27 -0) 📝 `crates/horizon-client/src/game/packs.rs` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. `#7149` packed the mod image slot only when `mod_api::mods()` was not empty. That list is the harness's trait mods, and a native mod built from mixins is not one: it runs through its injections, so the list stays empty and the slot was never packed. A world map mod that draws into it got `false` from `native_mod_image` and `native_sprite` found no sprite — the map stayed black. This reads the build instead: the launcher writes `native-mods.json` beside the executable for a game it built with mods (`BUILD_INFO`, already used for the crash report and the not-built rows), and a release or Nightly has no such file. - `mods::built_with_native_mods()`: `current_exe()`'s `native-mods.json`, `mods` list non-empty. - `game.rs` and `game/packs.rs` pass that instead of `!mod_api::mods().is_empty()`. - One unit test pins the parse: empty, `{}`, an empty list, a non-list and a listed mod. Seen on a local build of this branch with a world map native mod: the map draws, where before the slot was missing. Without a mod built in, nothing changes. The `pr_ready` block follows as a comment. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7658
No description provided.