[Scummvm-git-logs] scummvm master -> 2258c07929b21d9e2a662e8f28c3c2f732ae084b
sluicebox
noreply at scummvm.org
Mon Nov 18 01:10:47 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4fa670935f AGI: PREAGI: Fix Eeyore not accepting his popped balloon
2258c07929 AGI: PREAGI: Fix more WINNIE drop-object behavior
Commit: 4fa670935f386afaef50724f85e94cc9ae3a3d2b
https://github.com/scummvm/scummvm/commit/4fa670935f386afaef50724f85e94cc9ae3a3d2b
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-11-17T17:09:59-08:00
Commit Message:
AGI: PREAGI: Fix Eeyore not accepting his popped balloon
He loves it!
Changed paths:
engines/agi/preagi/winnie.cpp
diff --git a/engines/agi/preagi/winnie.cpp b/engines/agi/preagi/winnie.cpp
index e77f578b045..c8b78937942 100644
--- a/engines/agi/preagi/winnie.cpp
+++ b/engines/agi/preagi/winnie.cpp
@@ -508,9 +508,23 @@ bool WinnieEngine::isRightObj(int iRoom, int iObj, int *iCode) {
free(roomdata);
free(objdata);
+ // must return the object id before the workarounds are applied below.
+ // dropping the board (objId 34) must set flag 34 to change the room
+ // above the bridge, but the pine cones and sticks (objId 11) must not.
*iCode = objhdr.objId;
- if (objhdr.objId == 11) objhdr.objId = 34;
+ // The pine cones and sticks have an id that does not exist in any room.
+ // The game worked around this by using the correct id for the bridge.
+ if (objhdr.objId == 11) {
+ objhdr.objId = 34; // bridge
+ }
+
+ // Eeyore's popped balloon is assigned to Piglet in the data file.
+ // The game's executable must contain a hard-coded workaround,
+ // because the balloon is correctly assigned to Eeyore at runtime.
+ if (iObj == 25 && objhdr.objId == 8) { // popped balloon, Piglet
+ objhdr.objId = 7; // Eeyore
+ }
if (roomhdr.objId == objhdr.objId)
return true;
@@ -539,7 +553,7 @@ void WinnieEngine::takeObj(int iRoom) {
printObjStr(_gameStateWinnie.iObjHave, IDI_WTP_OBJ_TAKE);
getSelection(kSelAnyKey);
- // HACK WARNING
+ // set the has-lantern flag when taking the lantern
if (iObj == 18) {
_gameStateWinnie.fGame[0x0d] = 1;
}
@@ -554,7 +568,7 @@ void WinnieEngine::dropObj(int iRoom) {
printStr(IDS_WTP_CANT_DROP);
getSelection(kSelAnyKey);
} else {
- // HACK WARNING
+ // clear the has-lantern flag when dropping the lantern
if (_gameStateWinnie.iObjHave == 18) {
_gameStateWinnie.fGame[0x0d] = 0;
}
Commit: 2258c07929b21d9e2a662e8f28c3c2f732ae084b
https://github.com/scummvm/scummvm/commit/2258c07929b21d9e2a662e8f28c3c2f732ae084b
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-11-17T17:09:59-08:00
Commit Message:
AGI: PREAGI: Fix more WINNIE drop-object behavior
Fixes menu options after giving Pooh or Kanga their first object.
Fixes climbing the tree after dropping the board in the bridge.
Changed paths:
engines/agi/preagi/winnie.cpp
engines/agi/preagi/winnie.h
diff --git a/engines/agi/preagi/winnie.cpp b/engines/agi/preagi/winnie.cpp
index c8b78937942..76b9b1abdb6 100644
--- a/engines/agi/preagi/winnie.cpp
+++ b/engines/agi/preagi/winnie.cpp
@@ -367,10 +367,15 @@ int WinnieEngine::parser(int pc, int index, uint8 *buffer) {
takeObj(_room);
setTakeDrop(fCanSel);
break;
- case IDI_WTP_SEL_DROP:
- dropObj(_room);
+ case IDI_WTP_SEL_DROP: {
+ bool droppedInRightRoom = dropObj(_room);
setTakeDrop(fCanSel);
+ if (droppedInRightRoom) {
+ // reload room so that the dropped object's flag takes effect
+ return IDI_WTP_PAR_OK;
+ }
break;
+ }
default:
break;
}
@@ -560,7 +565,8 @@ void WinnieEngine::takeObj(int iRoom) {
}
}
-void WinnieEngine::dropObj(int iRoom) {
+// returns true if object was dropped in the right room
+bool WinnieEngine::dropObj(int iRoom) {
int iCode;
if (getObjInRoom(iRoom)) {
@@ -605,6 +611,7 @@ void WinnieEngine::dropObj(int iRoom) {
printStr(IDS_WTP_GAME_OVER_1);
getSelection(kSelAnyKey);
}
+ return true; // object dropped in right room
} else {
// drop object in the given room
_gameStateWinnie.iObjRoom[_gameStateWinnie.iObjHave] = iRoom;
@@ -627,6 +634,7 @@ void WinnieEngine::dropObj(int iRoom) {
_gameStateWinnie.iObjHave = 0;
}
}
+ return false; // object not dropped in right room
}
void WinnieEngine::dropObjRnd() {
diff --git a/engines/agi/preagi/winnie.h b/engines/agi/preagi/winnie.h
index 2ece0045ff5..81953655542 100644
--- a/engines/agi/preagi/winnie.h
+++ b/engines/agi/preagi/winnie.h
@@ -327,7 +327,7 @@ private:
void printObjStr(int, int);
uint32 readObj(int, uint8 *);
void takeObj(int);
- void dropObj(int);
+ bool dropObj(int);
bool isRightObj(int, int, int *);
void drawObjPic(int, int, int);
void getMenuMouseSel(int *, int[], int, int);
More information about the Scummvm-git-logs
mailing list