[Scummvm-git-logs] scummvm master -> c236ac5c292572adac8cec2bed83b5e61600055f
dreammaster
noreply at scummvm.org
Thu Jun 4 10:43:50 UTC 2026
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
ea1b1e96fb MM: MM1: Fix stale view close handling
3ab2933001 MM: MM1: Use DOS spell result formatting
c236ac5c29 MM: MM1: Fix targeted spell casting crash
Commit: ea1b1e96fb6a93f43aeadf52b51df788008365ec
https://github.com/scummvm/scummvm/commit/ea1b1e96fb6a93f43aeadf52b51df788008365ec
Author: Scorp (scorp at mrs.mn)
Date: 2026-06-04T20:43:44+10:00
Commit Message:
MM: MM1: Fix stale view close handling
Changed paths:
engines/mm/mm1/events.cpp
diff --git a/engines/mm/mm1/events.cpp b/engines/mm/mm1/events.cpp
index 6f5499f112f..197e6823d54 100644
--- a/engines/mm/mm1/events.cpp
+++ b/engines/mm/mm1/events.cpp
@@ -134,7 +134,7 @@ void Events::replaceView(UIElement *ui, bool replaceAllViews) {
}
void Events::replaceView(const Common::String &name, bool replaceAllViews) {
- replaceView(findView(name));
+ replaceView(findView(name), replaceAllViews);
}
void Events::addView(UIElement *ui) {
@@ -272,8 +272,10 @@ void UIElement::focus() {
}
void UIElement::close() {
- assert(g_engine->focusedView() == this);
- g_engine->popView();
+ if (g_events->focusedView() != this)
+ return;
+
+ g_events->popView();
}
bool UIElement::isFocused() const {
Commit: 3ab2933001b44af4dddee6f7eee09738f34afd71
https://github.com/scummvm/scummvm/commit/3ab2933001b44af4dddee6f7eee09738f34afd71
Author: Scorp (scorp at mrs.mn)
Date: 2026-06-04T20:43:44+10:00
Commit Message:
MM: MM1: Use DOS spell result formatting
Changed paths:
engines/mm/mm1/game/combat.cpp
engines/mm/mm1/game/spell_casting.cpp
engines/mm/mm1/game/spell_casting.h
engines/mm/mm1/views/spells/cast_spell.cpp
engines/mm/mm1/views/spells/spell_view.cpp
diff --git a/engines/mm/mm1/game/combat.cpp b/engines/mm/mm1/game/combat.cpp
index 7a25411c34c..3da28dc6cfa 100644
--- a/engines/mm/mm1/game/combat.cpp
+++ b/engines/mm/mm1/game/combat.cpp
@@ -20,6 +20,7 @@
*/
#include "mm/mm1/game/combat.h"
+#include "mm/mm1/game/spell_casting.h"
#include "mm/mm1/globals.h"
#include "mm/mm1/mm1.h"
#include "mm/mm1/sound.h"
@@ -1107,8 +1108,7 @@ void Combat::resetDestMonster() {
void Combat::spellFailed() {
g_globals->_combatParty[_currentChar]->_checked = true;
- SoundMessage msg(10, 2, Common::String::format("*** %s ***",
- STRING["spells.failed"].c_str()));
+ SoundMessage msg(10, 2, SpellCasting::spellResultMessage(STRING["spells.failed"]));
msg._delaySeconds = 3;
displaySpellResult(msg);
}
diff --git a/engines/mm/mm1/game/spell_casting.cpp b/engines/mm/mm1/game/spell_casting.cpp
index b4d1d43e56d..98c880bc699 100644
--- a/engines/mm/mm1/game/spell_casting.cpp
+++ b/engines/mm/mm1/game/spell_casting.cpp
@@ -179,7 +179,7 @@ Common::String SpellCasting::getSpellError() const {
}
if (!isInCombat())
- msg = Common::String::format("*** %s ***", msg.c_str());
+ msg = spellResultMessage(msg);
return msg;
}
@@ -187,6 +187,10 @@ bool SpellCasting::isInCombat() const {
return g_events->isPresent("Combat");
}
+Common::String SpellCasting::spellResultMessage(const Common::String &msg) {
+ return Common::String::format("*** %s ***", msg.c_str());
+}
+
} // namespace Game
} // namespace MM1
} // namespace MM
diff --git a/engines/mm/mm1/game/spell_casting.h b/engines/mm/mm1/game/spell_casting.h
index d4a53e8bae0..340b955aca3 100644
--- a/engines/mm/mm1/game/spell_casting.h
+++ b/engines/mm/mm1/game/spell_casting.h
@@ -98,6 +98,11 @@ public:
* Returns the error message
*/
Common::String getSpellError() const;
+
+ /**
+ * Returns a spell result message formatted as in the DOS executable.
+ */
+ static Common::String spellResultMessage(const Common::String &msg);
};
} // namespace Game
diff --git a/engines/mm/mm1/views/spells/cast_spell.cpp b/engines/mm/mm1/views/spells/cast_spell.cpp
index b64c8d6dc61..bdd54165b0b 100644
--- a/engines/mm/mm1/views/spells/cast_spell.cpp
+++ b/engines/mm/mm1/views/spells/cast_spell.cpp
@@ -241,16 +241,20 @@ void CastSpell::spellDone() {
}
void CastSpell::spellDone(const Common::String &msg, int xp) {
+ Common::String result = msg.hasPrefix("*** ") ? msg :
+ spellResultMessage(msg);
+ xp = 20 - (result.size() / 2);
+
if (isInCombat()) {
close();
- GameMessage gameMsg("SPELL_RESULT", msg);
+ GameMessage gameMsg("SPELL_RESULT", result);
gameMsg._value = xp;
g_events->focusedView()->send(gameMsg);
} else {
Sound::sound(SOUND_2);
- _spellResult = msg;
+ _spellResult = result;
_spellResultX = xp;
setState(ENDING);
}
diff --git a/engines/mm/mm1/views/spells/spell_view.cpp b/engines/mm/mm1/views/spells/spell_view.cpp
index ca74c73f98c..efdc79a27a8 100644
--- a/engines/mm/mm1/views/spells/spell_view.cpp
+++ b/engines/mm/mm1/views/spells/spell_view.cpp
@@ -20,6 +20,7 @@
*/
#include "mm/mm1/views/spells/spell_view.h"
+#include "mm/mm1/game/spell_casting.h"
#include "mm/mm1/globals.h"
#include "mm/mm1/sound.h"
@@ -31,7 +32,7 @@ namespace Spells {
void SpellView::spellFailed() {
// Spell failed
clearSurface();
- writeString(10, 2, STRING["spells.failed"]);
+ writeString(10, 2, Game::SpellCasting::spellResultMessage(STRING["spells.failed"]));
Sound::sound(SOUND_2);
delaySeconds(3);
@@ -39,7 +40,7 @@ void SpellView::spellFailed() {
void SpellView::spellDone() {
clearSurface();
- writeString(14, 2, STRING["spells.done"]);
+ writeString(14, 2, Game::SpellCasting::spellResultMessage(STRING["spells.done"]));
g_globals->_party.updateAC();
Sound::sound(SOUND_2);
Commit: c236ac5c292572adac8cec2bed83b5e61600055f
https://github.com/scummvm/scummvm/commit/c236ac5c292572adac8cec2bed83b5e61600055f
Author: Scorp (scorp at mrs.mn)
Date: 2026-06-04T20:43:44+10:00
Commit Message:
MM: MM1: Fix targeted spell casting crash
Changed paths:
engines/mm/mm1/views/spells/cast_spell.cpp
diff --git a/engines/mm/mm1/views/spells/cast_spell.cpp b/engines/mm/mm1/views/spells/cast_spell.cpp
index bdd54165b0b..7b76203e934 100644
--- a/engines/mm/mm1/views/spells/cast_spell.cpp
+++ b/engines/mm/mm1/views/spells/cast_spell.cpp
@@ -183,7 +183,8 @@ bool CastSpell::msgAction(const ActionMessage &msg) {
} else if (msg._action == KEYBIND_SELECT) {
// Time to execute the spell
- performSpell();
+ if (_state == PRESS_ENTER)
+ performSpell();
} else if (_state == SELECT_CHAR &&
msg._action >= KEYBIND_VIEW_PARTY1 &&
More information about the Scummvm-git-logs
mailing list