From 60b7f46801a85aefb9c8bb2c22d44905caefc55e Mon Sep 17 00:00:00 2001 From: Roy Love Date: Sat, 18 Apr 2026 07:11:13 -0500 Subject: [PATCH] fix: use PLAYER_CLASS_COUNT upper bound in GetSpellLevel guard Addresses reviewer feedback to use Class::PLAYER_CLASS_COUNT instead of Class::Berserker so a future new class won't hit the same off-by-one. Co-Authored-By: Claude Sonnet 4.6 --- common/spdat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spdat.cpp b/common/spdat.cpp index 3474e0d30..01bf12efe 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -999,7 +999,7 @@ uint8 GetSpellLevel(uint16 spell_id, uint8 class_id) return UINT8_MAX; } - if (class_id < Class::Warrior || class_id > Class::Berserker) { + if (class_id < Class::Warrior || class_id > Class::PLAYER_CLASS_COUNT) { return UINT8_MAX; }