[Scummvm-git-logs] scummvm master -> eff4a3ec723e72bdd0ce03924a437240a35093e8

bluegr noreply at scummvm.org
Thu Dec 26 18:48:39 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
eff4a3ec72 ULTIMA: NUVIE: Fix spell descriptions when spell book is not full


Commit: eff4a3ec723e72bdd0ce03924a437240a35093e8
    https://github.com/scummvm/scummvm/commit/eff4a3ec723e72bdd0ce03924a437240a35093e8
Author: malignantmanor (malignantmanor at users.noreply.github.com)
Date: 2024-12-26T20:48:36+02:00

Commit Message:
ULTIMA: NUVIE: Fix spell descriptions when spell book is not full

When you use the look command to look at the spell incantation and reagents required, it gets the wrong index if there are any missing spells on that page before the one you try to look at.

Changed paths:
    engines/ultima/nuvie/views/spell_view.cpp


diff --git a/engines/ultima/nuvie/views/spell_view.cpp b/engines/ultima/nuvie/views/spell_view.cpp
index 95afc903a03..59c9dfda3d7 100644
--- a/engines/ultima/nuvie/views/spell_view.cpp
+++ b/engines/ultima/nuvie/views/spell_view.cpp
@@ -516,8 +516,9 @@ void SpellView::close_look() {
 
 void SpellView::show_spell_description() {
 	if (get_selected_index() != -1) {
-		uint8 index = (level - 1) * 16 + get_selected_index();
-		Game::get_game()->get_magic()->show_spell_description(index);
+		sint16 index = get_selected_spell();
+		if (index < 256 && index > -1)
+			Game::get_game()->get_magic()->show_spell_description((uint8)index);
 	}
 	close_look();
 }




More information about the Scummvm-git-logs mailing list