From 10759e955ec9329eca0101768ae6c146e3114294 Mon Sep 17 00:00:00 2001 From: Ihar Hubchyk Date: Fri, 17 May 2024 22:44:12 +0800 Subject: [PATCH 1/3] Remove random spells from Spell Scroll within Hero dialog relates to #6845 --- src/fheroes2/resource/artifact.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fheroes2/resource/artifact.cpp b/src/fheroes2/resource/artifact.cpp index b5cd5526de1..e1d6dec6202 100644 --- a/src/fheroes2/resource/artifact.cpp +++ b/src/fheroes2/resource/artifact.cpp @@ -1195,7 +1195,7 @@ bool ArtifactsBar::ActionBarLeftMouseSingleClick( Artifact & art ) const_cast( _hero )->SpellBookActivate(); } else if ( art.GetID() == Artifact::SPELL_SCROLL ) { - const int spellId = Dialog::selectSpell( Spell::RANDOM, true ).GetID(); + const int spellId = Dialog::selectSpell( Spell::RANDOM, false ).GetID(); if ( spellId == Spell::NONE ) { // No spell for the Spell Scroll artifact was selected - cancel the artifact selection. From c6951f783094cd7b9dca9a25eda931066481de08 Mon Sep 17 00:00:00 2001 From: Ihar Hubchyk Date: Fri, 17 May 2024 22:45:12 +0800 Subject: [PATCH 2/3] Fix copyright year --- src/fheroes2/resource/artifact.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fheroes2/resource/artifact.cpp b/src/fheroes2/resource/artifact.cpp index e1d6dec6202..dfcb8d09eba 100644 --- a/src/fheroes2/resource/artifact.cpp +++ b/src/fheroes2/resource/artifact.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * fheroes2: https://github.com/ihhub/fheroes2 * - * Copyright (C) 2019 - 2023 * + * Copyright (C) 2019 - 2024 * * * * Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 * * Copyright (C) 2009 by Andrey Afletdinov * From 5d51b1e60870819579484e298623064f2de96951 Mon Sep 17 00:00:00 2001 From: Ihar Hubchyk Date: Fri, 17 May 2024 22:51:09 +0800 Subject: [PATCH 3/3] Show a message for Spell Book duplication --- src/fheroes2/resource/artifact.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fheroes2/resource/artifact.cpp b/src/fheroes2/resource/artifact.cpp index dfcb8d09eba..9a12e0e1f8c 100644 --- a/src/fheroes2/resource/artifact.cpp +++ b/src/fheroes2/resource/artifact.cpp @@ -1192,7 +1192,12 @@ bool ArtifactsBar::ActionBarLeftMouseSingleClick( Artifact & art ) if ( isMagicBook( art ) ) { art.Reset(); - const_cast( _hero )->SpellBookActivate(); + if ( _hero->HaveSpellBook() ) { + fheroes2::showStandardTextMessage( Artifact( Artifact::MAGIC_BOOK ).GetName(), _( "You cannot have multiple spell books." ), Dialog::OK ); + } + else { + const_cast( _hero )->SpellBookActivate(); + } } else if ( art.GetID() == Artifact::SPELL_SCROLL ) { const int spellId = Dialog::selectSpell( Spell::RANDOM, false ).GetID();