[Scummvm-tracker] [ScummVM :: Bugs] #14616: SCUMM: FT: Crash with Assertion Fail when riding the bike for the first time

ScummVM :: Bugs trac at scummvm.org
Sun Sep 10 14:08:14 UTC 2023


#14616: SCUMM: FT: Crash with Assertion Fail when riding the bike for the first
time
-----------------------------------+----------------------------
Reporter:  antoniou79              |       Owner:  (none)
    Type:  defect                  |      Status:  new
Priority:  normal                  |   Component:  Engine: SCUMM
 Version:                          |  Resolution:
Keywords:  crash, acos, assertion  |        Game:  Full Throttle
-----------------------------------+----------------------------
Comment (by PushmePullyu):

 This seems to be a regression introduced by commit
 !8a54e258a5aeac082ebb3a444d0c57138b6694f0 "SCUMM: (SCUMM7/8) - fix actor
 turning animation"

 I only tested with The Dig, but here the cause is trying to load a costume
 with index 0 via hasManyDirections(int):

 in engines/scumm/actor.cpp:1522
 in void Actor::setDirection(int direction):
 {{{
 // Normalize the angle
 _facing = normalizeAngle(_vm->_costumeLoader->hasManyDirections(_costume),
 direction);

 }}}

 Running with --debugflags=RESOURCE produces these messages:
 {{{
 ensureResourceLoaded(Costume,0)
 getResourceAddress(Costume,0) == NULL
 }}}

 I am not familiar with the engine, maybe something like this could be done
 (not sure whether it should default to returning false or true):
 {{{
 diff --git a/engines/scumm/akos.h b/engines/scumm/akos.h
 index e17d922791c..855f2a3fcad 100644
 --- a/engines/scumm/akos.h
 +++ b/engines/scumm/akos.h
 @@ -48,6 +48,8 @@ public:

         //void animateLimb(int limb, int f);
         bool hasManyDirections(int id) override {
 +               if (id == 0)
 +                       return false;
                 loadCostume(id);
                 return hasManyDirections();
         }
 }}}
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/14616#comment:2>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list