[PR #6193] [MERGED] Refuse the lead while a nautilus is angry #6714

Closed
opened 2026-11-03 06:25:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6193
Author: @MSedgeMC
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/nautilus-leash


📝 Commits (1)

  • 9685f3a Refuse the lead while a nautilus is angry

📊 Changes

2 files changed (+41 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/mobs/leash.rs (+35 -0)
📝 crates/horizon-client/src/mobs/nautilus.rs (+6 -0)

📄 Description

Nautilus.canBeLeashed is !isAggravated(), and
AbstractNautilus.isAggravated is the brain holding either memory:

// javap -p -c on AbstractNautilus
 1: invokevirtual getBrain
 4: getstatic     MemoryModuleType.ANGRY_AT
 7: invokevirtual Brain.hasMemoryValue
10: ifne          26
13: invokevirtual getBrain
17: getstatic     MemoryModuleType.ATTACK_TARGET
20: invokevirtual Brain.hasMemoryValue
23: ifeq          30
26: iconst_1 ... 31: ireturn

ZombieNautilus.canBeLeashed is the same test plus !isMobControlled(). Horizon's
can_be_leashed had no nautilus arm, so both fell through to the generic
!hostile && !removed and a nautilus could be leashed while it was charging at a pufferfish
or at whoever hurt it.

Proven: on the build VM, cargo test -q -p horizon-client --lib an_aggravated_nautilus_cannot_be_leashed
→ 1 passed, covering a calm nautilus, an angry one (anger timer), a zombie nautilus with an
attack target, and a calm zombie nautilus.

Not proven: not checked in game. The in-game check: hit a nautilus and try to put a lead on it
while it is aggressive.

One known gap, marked shortcut: in the code: ZombieNautilus.canBeLeashed also refuses while a
mob rides it (isMobControlled, getFirstPassenger() instanceof Mob). can_be_leashed only
sees the mob itself and Horizon keeps no rider list on it, so that half is not implemented; nothing
in 26.3 puts a mob on a zombie nautilus today.


🔄 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/6193 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/nautilus-leash` --- ### 📝 Commits (1) - [`9685f3a`](https://github.com/horizon-rust/horizon/commit/9685f3a127b33b813d859a24189e3982beee42f2) Refuse the lead while a nautilus is angry ### 📊 Changes **2 files changed** (+41 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/leash.rs` (+35 -0) 📝 `crates/horizon-client/src/mobs/nautilus.rs` (+6 -0) </details> ### 📄 Description `Nautilus.canBeLeashed` is `!isAggravated()`, and `AbstractNautilus.isAggravated` is the brain holding either memory: ```java // javap -p -c on AbstractNautilus 1: invokevirtual getBrain 4: getstatic MemoryModuleType.ANGRY_AT 7: invokevirtual Brain.hasMemoryValue 10: ifne 26 13: invokevirtual getBrain 17: getstatic MemoryModuleType.ATTACK_TARGET 20: invokevirtual Brain.hasMemoryValue 23: ifeq 30 26: iconst_1 ... 31: ireturn ``` `ZombieNautilus.canBeLeashed` is the same test plus `!isMobControlled()`. Horizon's `can_be_leashed` had no nautilus arm, so both fell through to the generic `!hostile && !removed` and a nautilus could be leashed while it was charging at a pufferfish or at whoever hurt it. **Proven:** on the build VM, `cargo test -q -p horizon-client --lib an_aggravated_nautilus_cannot_be_leashed` → `1 passed`, covering a calm nautilus, an angry one (`anger` timer), a zombie nautilus with an attack target, and a calm zombie nautilus. **Not proven:** not checked in game. The in-game check: hit a nautilus and try to put a lead on it while it is aggressive. One known gap, marked `shortcut:` in the code: `ZombieNautilus.canBeLeashed` also refuses while a **mob** rides it (`isMobControlled`, `getFirstPassenger() instanceof Mob`). `can_be_leashed` only sees the mob itself and Horizon keeps no rider list on it, so that half is not implemented; nothing in 26.3 puts a mob on a zombie nautilus today. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:25:21 +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#6714
No description provided.