[Scummvm-git-logs] scummvm master -> 7e903367cc840892da7a582a577077b7ef297129

joostp noreply at scummvm.org
Wed Aug 3 15:28:23 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7e903367cc ICB: ELDORADO: add fn_set_manual_interact_object() and fn_cancel_manual_interact_object()


Commit: 7e903367cc840892da7a582a577077b7ef297129
    https://github.com/scummvm/scummvm/commit/7e903367cc840892da7a582a577077b7ef297129
Author: Joost Peters (joostp at 7fc1.org)
Date: 2022-08-03T17:27:58+02:00

Commit Message:
ICB: ELDORADO: add fn_set_manual_interact_object() and fn_cancel_manual_interact_object()

Changed paths:
    engines/icb/function.cpp
    engines/icb/session.h


diff --git a/engines/icb/function.cpp b/engines/icb/function.cpp
index fbcffee362d..9f01caec292 100644
--- a/engines/icb/function.cpp
+++ b/engines/icb/function.cpp
@@ -297,6 +297,10 @@ mcodeFunctionReturnCodes fn_snap_to_ladder_bottom(int32 &result, int32 *params)
 
 mcodeFunctionReturnCodes fn_snap_to_ladder_top(int32 &result, int32 *params) { return (MS->fn_snap_to_ladder_top(result, params)); }
 
+mcodeFunctionReturnCodes fn_set_manual_interact_object(int32 &result, int32 *params) { return (MS->fn_set_manual_interact_object(result, params)); }
+
+mcodeFunctionReturnCodes fn_cancel_manual_interact_object(int32 &result, int32 *params) { return (MS->fn_cancel_manual_interact_object(result, params)); }
+
 mcodeFunctionReturnCodes fn_PLEASE_REUSE_THIS_SLOT_2(int32 &, int32 *) { return IR_CONT; }
 
 mcodeFunctionReturnCodes fn_PLEASE_REUSE_THIS_SLOT_3(int32 &, int32 *) { return IR_CONT; }
@@ -3372,6 +3376,32 @@ mcodeFunctionReturnCodes _game_session::fn_snap_to_ladder_top(int32 &, int32 *)
 	return IR_CONT;
 }
 
+mcodeFunctionReturnCodes _game_session::fn_set_manual_interact_object(int32 &, int32 *params) {
+	const char *object_name = (const char *)MemoryUtil::resolvePtr(params[0]);
+
+	// Find the id for the named object.
+	uint32 nObjectID = LinkedDataObject::Fetch_item_number_by_name(objects, object_name);
+
+	// Check the object is valid.
+	if (nObjectID == PX_LINKED_DATA_FILE_ERROR)
+		Fatal_error("fn_set_manual_interact_object( %s ) - object does not exist", object_name);
+
+	// Clear the script-forced object interact id.
+	player.cur_interact_id = nObjectID;
+
+	// Calling script can continue.
+	return IR_CONT;
+}
+
+mcodeFunctionReturnCodes _game_session::fn_cancel_manual_interact_object(int32 &, int32 *) {
+	// Clear the script-forced object interact id.
+	player.cur_interact_id = -1;
+
+	// Calling script can continue.
+	return IR_CONT;
+
+}
+
 mcodeFunctionReturnCodes _game_session::fn_set_to_floor(int32 &, int32 *params) {
 	// locate a character onto a specified floor
 	// crudely sticks the character in the middle of the first floor LRECT
diff --git a/engines/icb/session.h b/engines/icb/session.h
index bb1eb03a59f..63e5df1d324 100644
--- a/engines/icb/session.h
+++ b/engines/icb/session.h
@@ -661,6 +661,9 @@ public:
 	mcodeFunctionReturnCodes fn_snap_to_ladder_bottom(int32 &, int32 *);
 	mcodeFunctionReturnCodes fn_snap_to_ladder_top(int32 &, int32 *);
 
+	mcodeFunctionReturnCodes fn_set_manual_interact_object(int32 &, int32 *);
+	mcodeFunctionReturnCodes fn_cancel_manual_interact_object(int32 &, int32 *);
+
 	mcodeFunctionReturnCodes fn_set_feet_to_pan(int32 &, int32 *);
 	mcodeFunctionReturnCodes fn_room_route(int32 &, int32 *);
 	mcodeFunctionReturnCodes fn_hard_load_generic_anim(int32 &, int32 *);




More information about the Scummvm-git-logs mailing list