Skip to content

Fix Priest party-sanc gate reading char.base.tier twice#95

Open
rodarvus wants to merge 1 commit into
zzyzzyzzx:masterfrom
rodarvus:fix/priest-sanc-level-gmcp-field
Open

Fix Priest party-sanc gate reading char.base.tier twice#95
rodarvus wants to merge 1 commit into
zzyzzyzzx:masterfrom
rodarvus:fix/priest-sanc-level-gmcp-field

Conversation

@rodarvus

Copy link
Copy Markdown

Summary

In SpellupRecast/Hadar_Spellups.xml, the affoff() function has logic that recasts party sanctuary instead of plain sanctuary for high-level Priests when Sanctuary (sn 71) wears off. The gate that enables that path computes totalLevel = playerLevel + playerTier and checks totalLevel >= 121.

playerLevel was being read from char.base.tier instead of char.base.level, so totalLevel was effectively tier + tier. That is always far below 121 for any reasonable character, which made the entire Priest party-sanc branch dead code in practice — plain sanctuary would be recast instead of party sanctuary regardless of the player's level.

This one-line change reads char.base.level for playerLevel so the gate behaves as the surrounding code clearly intends.

Before

local playerTier  = tonumber(gmcp("char.base.tier")) or -1
local playerLevel = tonumber(gmcp("char.base.tier")) or -1   -- bug: same field
local totalLevel  = tonumber(playerLevel + playerTier)

After

local playerTier  = tonumber(gmcp("char.base.tier")) or -1
local playerLevel = tonumber(gmcp("char.base.level")) or -1
local totalLevel  = tonumber(playerLevel + playerTier)

Test plan

  • As a subclass-Priest with level + tier >= 121, let plain Sanctuary (sn 71) drop and confirm the plugin sends cast 'party sanctuary' (verified live in MUSHclient).
  • Confirm the fix does not affect non-Priest casts or Priests below the threshold.

🤖 Generated with Claude Code

In affoff() the gate that decides whether a high-level Priest should
recast party sanctuary instead of plain sanctuary computed totalLevel
as tier+tier, because playerLevel was being read from char.base.tier.
That made totalLevel always tiny (2-18) and the >= 121 check always
false, leaving the party-sanc branch as dead code.

Read char.base.level for playerLevel so totalLevel is level+tier as
the surrounding logic expects.

Co-Authored-By: Claude Opus 4.7 (1M context) <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.

1 participant