[Scummvm-git-logs] scummvm master -> 901849af8c96e42da12a63deabdcac13c809740e
mduggan
mgithub at guarana.org
Sat Aug 21 01:04:59 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0bce42b8f2 ULTIMA8: Fix saving when using original journal UI
ccc574430b ULTIMA8: Print warning if bark fails
53e8f5090c ULTIMA8: Refine hack of destroying things that fall below floor
901849af8c ULTIMA8: JANITORIAL whitespace
Commit: 0bce42b8f2d6953c1a94ade1acc377b6d42cc715
https://github.com/scummvm/scummvm/commit/0bce42b8f2d6953c1a94ade1acc377b6d42cc715
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-08-21T08:48:59+09:00
Commit Message:
ULTIMA8: Fix saving when using original journal UI
Changed paths:
engines/ultima/ultima8/gumps/u8_save_gump.cpp
diff --git a/engines/ultima/ultima8/gumps/u8_save_gump.cpp b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
index e83ba3de32..38090313ac 100644
--- a/engines/ultima/ultima8/gumps/u8_save_gump.cpp
+++ b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
@@ -222,14 +222,14 @@ void U8SaveGump::onMouseClick(int button, int32 mx, int32 my) {
void U8SaveGump::ChildNotify(Gump *child, uint32 message) {
EditWidget *widget = dynamic_cast<EditWidget *>(child);
if (widget && message == EditWidget::EDIT_ENTER) {
- // _save
+ // save
assert(_save);
Std::string name = widget->getText();
if (name.empty()) return;
- if (savegame(widget->GetIndex() + 6 * _page, name))
- _parent->Close(); // close PagedGump (and us)
+ // Note: this might close us, so we should return right after.
+ savegame(widget->GetIndex() + 6 * _page, name);
return;
}
@@ -272,6 +272,10 @@ bool U8SaveGump::savegame(int saveIndex, const Std::string &name) {
if (name.empty()) return false;
+ // We are saving, close parent (and ourselves) first so it doesn't
+ // block the save or appear in the screenshot
+ _parent->Close();
+
Ultima8Engine::get_instance()->saveGame(saveIndex, name);
return true;
}
Commit: ccc574430b2599d2707f10f9e60c7df0221b3f8d
https://github.com/scummvm/scummvm/commit/ccc574430b2599d2707f10f9e60c7df0221b3f8d
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-08-21T10:01:51+09:00
Commit Message:
ULTIMA8: Print warning if bark fails
Changed paths:
engines/ultima/ultima8/world/item.cpp
diff --git a/engines/ultima/ultima8/world/item.cpp b/engines/ultima/ultima8/world/item.cpp
index 6336a19432..ecb51e9bf2 100644
--- a/engines/ultima/ultima8/world/item.cpp
+++ b/engines/ultima/ultima8/world/item.cpp
@@ -3004,23 +3004,30 @@ uint32 Item::I_getWeightIncludingContents(const uint8 *args,
uint32 Item::I_bark(const uint8 *args, unsigned int /*argsize*/) {
ARG_ITEM_FROM_PTR(item);
ARG_STRING(str);
- if (id_item == 666) item = getItem(1);
- if (!item) return 0; // Hack!
+ if (id_item == 666)
+ item = getItem(1);
+
+ if (!item) {
+ // Hack! Items should always be valid?
+ warning("skipping bark of '%s' because item invalid.", str.c_str());
+ return 0;
+ }
uint32 shapenum = item->getShape();
- if (id_item == 666) shapenum = 666; // Hack for guardian barks
- Gump *_gump = new BarkGump(item->getObjId(), str, shapenum);
+ if (id_item == 666)
+ shapenum = 666; // Hack for guardian barks
+ Gump *gump = new BarkGump(item->getObjId(), str, shapenum);
if (item->getObjId() < 256) { // CONSTANT!
GumpNotifyProcess *notifyproc;
notifyproc = new ActorBarkNotifyProcess(item->getObjId());
Kernel::get_instance()->addProcess(notifyproc);
- _gump->SetNotifyProcess(notifyproc);
+ gump->SetNotifyProcess(notifyproc);
}
- _gump->InitGump(0);
+ gump->InitGump(0);
- return _gump->GetNotifyProcess()->getPid();
+ return gump->GetNotifyProcess()->getPid();
}
uint32 Item::I_look(const uint8 *args, unsigned int /*argsize*/) {
Commit: 53e8f5090c9b855eb39fae7875add92c176a13a5
https://github.com/scummvm/scummvm/commit/53e8f5090c9b855eb39fae7875add92c176a13a5
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-08-21T10:02:14+09:00
Commit Message:
ULTIMA8: Refine hack of destroying things that fall below floor
Fixes Mordea disappearing during wake-up game event (#12803).
The proper fix here is maybe to never let items fall below 0, which I think is
how the originals work, but that could have significant other impacts I'm not
sure about, so for now just refine the workaround.
Changed paths:
engines/ultima/ultima8/world/gravity_process.cpp
diff --git a/engines/ultima/ultima8/world/gravity_process.cpp b/engines/ultima/ultima8/world/gravity_process.cpp
index 68444c7c43..adeb5e9206 100644
--- a/engines/ultima/ultima8/world/gravity_process.cpp
+++ b/engines/ultima/ultima8/world/gravity_process.cpp
@@ -100,8 +100,14 @@ void GravityProcess::run() {
int32 ix, iy, iz;
item->getLocation(ix, iy, iz);
- if (iz < -1000) {
- // Shouldn't happen as item should always hit the floor.
+ //
+ // Shouldn't go very negative as item should always hit the floor.
+ //
+ // Slight hack here because Mordea falls through the floor when she
+ // wakes up - set a value big enough that the next event can happen
+ // before we destroy the actor.
+ //
+ if (iz < -5000) {
warning("Item %d fell too far, stopping GravityProcess", _itemNum);
terminate();
_itemNum = 0;
Commit: 901849af8c96e42da12a63deabdcac13c809740e
https://github.com/scummvm/scummvm/commit/901849af8c96e42da12a63deabdcac13c809740e
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-08-21T10:04:18+09:00
Commit Message:
ULTIMA8: JANITORIAL whitespace
Changed paths:
engines/ultima/ultima8/ultima8.cpp
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 82631897f3..4a59268fe4 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -982,7 +982,7 @@ bool Ultima8Engine::canSaveGameStateCurrently(bool isAutosave) {
bool Ultima8Engine::saveGame(int slot, const Std::string &desc) {
// Check for gumps that prevent saving
- if ( _desktopGump->FindGump(&HasPreventSaveFlag, true)) {
+ if (_desktopGump->FindGump(&HasPreventSaveFlag, true)) {
pout << "Can't save: open gump preventing save." << Std::endl;
return false;
}
More information about the Scummvm-git-logs
mailing list