Opened 14 months ago

Closed 12 months ago

Last modified 12 months ago

#10764 closed defect (fixed)

KYRA: LOL: Cannot Use Vaelan's Cube On Scottia's Barrier

Reported by: alois-kende Owned by: digitall
Priority: normal Component: Engine: Kyra
Keywords: vaelan's cube barrier too close Cc: c
Game: Lands of Lore

Description

When rightclicking in front of the barrier, it says I am too close to cast a spell. If I take a step back, the cube does do its visual effect but if has no effect on the barrier.

CD version
Android 5.1.1

Attachments (1)

lol-cd.006 (24.8 KB ) - added by alois-kende 14 months ago.
save file

Download all attachments as: .zip

Change History (14)

by alois-kende, 14 months ago

Attachment: lol-cd.006 added

save file

comment:1 by digitall, 14 months ago

Component: --Unset--Engine: Kyra
Summary: Cannot use vaelan's cube on scottia's barrierKYRA: LOL: Cannot Use Vaelan's Cube On Scottia's Barrier

comment:2 by digitall, 13 months ago

Owner: set to digitall
Resolution: worksforme
Status: newpending

Tested with latest git master on Linux x86_64 with the attached savegame. You need to choose Vaelan's cube from the inventory and right click on one of the characters while in front of the barrier. The first time does an animation and the second time removes the barrier and the cube is used up.

The upshot is that I can't replicate this issue with the current git master.

@alois-kende: What version of ScummVM on Android are you using? The version is below the ScummVM logo on the launcher screen.

comment:3 by digitall, 13 months ago

Possibly outdated... but pending feedback from user as can not replicate on desktop.

comment:4 by alois-kende, 13 months ago

I am using v2.0.0 of scummVM on Android. No update seem to be available on the play store.
Android v5.1.1 for reminder.

I had issues with the various shortcuts for right click (not any would work) so I mapped a physical key as the right click to counter this issue. I have no idea if this can induce the behavior I see on my device. Apart from that, I can think of nothing special about my device/setup.

comment:5 by alois-kende, 13 months ago

I just tested again. It does work. Maybe I didn't have v2.0.0 a month ago when submitting the ticket, which is odd...

comment:6 by alois-kende, 13 months ago

Owner: changed from digitall to alois-kende
Resolution: worksformeinvalid
Status: pendingclosed

comment:7 by alois-kende, 13 months ago

Owner: changed from alois-kende to digitall
Resolution: invalidworksforme
Status: closedpending

I reacted a bit to quickly. It does not work all the time. It only worked once and then by reloading the save the problem reappears. So I guess there is still a problem.

comment:8 by digitall, 13 months ago

Resolution: worksforme
Status: pendingnew

comment:9 by alois-kende, 13 months ago

I think I found how to reproduce the problem and how to avoid it.

The only way for the cube to be working on my device is :

  • Reboot the phone
  • Start scummVM
  • Start Lands of Lire
  • Load the save from WITHIN the game

-> Using cube on barrier works.

Now if I leave scummVM and don't reboot, it fails whatever I try.
If after rebooting, I start scummVM and load the save from OUTSIDE the game with the scummVM load save option, it fails as well.

Hope this helps ! (And if someone found this by googling their problem, they have a workaround :) )

comment:10 by digitall, 13 months ago

Hmm... Now I can replicate from both ScummVM launcher load and the in-game loading with ScummVM 2.1.0git3935-g442c578223 (Nov 22 2018 17:19:49) on Linux x86_64.

Looks like an unstable bug. Will run valgrind and see if I can locate any issue.

comment:11 by digitall, 13 months ago

Ah found the cause:

==21543== Invalid read of size 2
==21543==    at 0xD7EC4C: Kyra::LoLEngine::castSpell(int, int, int) (lol.cpp:1993)
==21543==    by 0xDA909E: Kyra::LoLEngine::olol_castSpell(Kyra::EMCState*) (script_lol.cpp:2077)
==21543==    by 0xDB1F41: Common::Functor1Mem<Kyra::EMCState*, int, Kyra::LoLEngine>::operator()(Kyra::EMCState*) const (func.h:451)
==21543==    by 0xD1472F: Kyra::EMCInterpreter::op_sysCall(Kyra::EMCState*) (script.cpp:306)
==21543==    by 0xD140DA: Kyra::EMCInterpreter::run(Kyra::EMCState*) (script.cpp:208)
==21543==    by 0xE90CC8: Kyra::LoLEngine::runItemScript(int, short, int, int, int) (items_lol.cpp:311)
==21543==    by 0xE86BA1: Kyra::LoLEngine::clickedPortraitEtcRight(Kyra::Button*) (gui_lol.cpp:1178)
==21543==    by 0xDCF035: Common::Functor1Mem<Kyra::Button*, int, Kyra::LoLEngine>::operator()(Kyra::Button*) const (func.h:451)
==21543==    by 0xE8B2D6: Kyra::GUI_LoL::processButtonList(Kyra::Button*, unsigned short, signed char) (gui_lol.cpp:2168)
==21543==    by 0xE687A8: Kyra::KyraEngine_v1::checkInput(Kyra::Button*, bool, int) (kyra_v1.cpp:343)
==21543==    by 0xE84B4C: Kyra::LoLEngine::gui_updateInput() (gui_lol.cpp:768)
==21543==    by 0xD7A292: Kyra::LoLEngine::runLoop() (lol.cpp:892)
==21543==  Address 0x1e044cda is 6 bytes before a block of size 63 alloc'd
==21543==    at 0x4C30F25: calloc (vg_replace_malloc.c:711)
==21543==    by 0x2013DF8: Graphics::Surface::create(unsigned short, unsigned short, Graphics::PixelFormat const&) (surface.cpp:74)
==21543==    by 0x200027E: Graphics::TTFFont::cacheGlyph(Graphics::TTFFont::Glyph&, unsigned int) const (ttf.cpp:597)
==21543==    by 0x1FFF160: Graphics::TTFFont::load(Common::SeekableReadStream&, int, Graphics::TTFSizeMode, unsigned int, Graphics::TTFRenderMode, unsigned int const*) (ttf.cpp:254)
==21543==    by 0x2000585: Graphics::loadTTFFont(Common::SeekableReadStream&, int, Graphics::TTFSizeMode, unsigned int, Graphics::TTFRenderMode, unsigned int const*) (ttf.cpp:661)
==21543==    by 0x1EE0D9F: GUI::ThemeEngine::loadScalableFont(Common::String const&, Common::String const&, int, Common::String&) (ThemeEngine.cpp:1482)
==21543==    by 0x1EE1193: GUI::ThemeEngine::loadFont(Common::String const&, Common::String const&, Common::String const&, int, bool) (ThemeEngine.cpp:1540)
==21543==    by 0x1EDD043: GUI::ThemeEngine::addFont(GUI::TextData, Common::String const&, Common::String const&, int) (ThemeEngine.cpp:526)
==21543==    by 0x1EEB45F: GUI::ThemeParser::parserCallback_font(Common::XMLParser::ParserNode*) (ThemeParser.cpp:187)
==21543==    by 0x1EF23CA: GUI::ThemeParser::CustomXMLKeyLayout::doCallback(Common::XMLParser*, Common::XMLParser::ParserNode*) (ThemeParser.h:53)
==21543==    by 0x1EF2344: GUI::ThemeParser::keyCallback(Common::XMLParser::ParserNode*) (ThemeParser.h:53)
==21543==    by 0x213B8BF: Common::XMLParser::parseActiveKey(bool) (xmlparser.cpp:196)
==21543== 

comment:12 by athrxx <athrxx@…>, 12 months ago

Resolution: fixed
Status: newclosed

In 4b2dc67c:

KYRA: (LOL) - fix #10764 (Cannot Use Vaelan's Cube)

comment:13 by athrxx, 12 months ago

I have made a commit to the git repository that should fix the bug.

It seems that we didn't import all of the static data from the original executable. That caused the invalid memory access and the random results for the vaelans cube.

Can you actually test this, although you play on Android?

Note: See TracTickets for help on using tickets.