From 2dee92a908b84ae870bfdbfd00318549485b7984 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 6 Aug 2012 20:03:56 +1000 Subject: TINSEL: Fixed portability issue with earlier savegames --- engines/tinsel/dialogs.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'engines/tinsel/dialogs.cpp') diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp index dde34841cf..56ee2ea752 100644 --- a/engines/tinsel/dialogs.cpp +++ b/engines/tinsel/dialogs.cpp @@ -1262,6 +1262,20 @@ static INV_OBJECT *GetInvObject(int id) { error("GetInvObject(%d): Trying to manipulate undefined inventory icon", id); } +/** + * Returns true if the given id represents a valid inventory object + */ +bool GetIsInvObject(int id) { + INV_OBJECT *pObject = g_invObjects; + + for (int i = 0; i < g_numObjects; i++, pObject++) { + if (pObject->id == id) + return true; + } + + return false; +} + /** * Convert item ID number to index. */ -- cgit v1.2.3