From baac2939118a3cb6ca0d8f8ddd0d7b8edfe64109 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Wed, 4 Oct 2006 03:29:14 +0000 Subject: Add more code for WW svn-id: r24103 --- engines/agos/rooms.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'engines/agos/rooms.cpp') diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp index 2af76d8c60..e321485e53 100644 --- a/engines/agos/rooms.cpp +++ b/engines/agos/rooms.cpp @@ -62,6 +62,29 @@ uint16 AGOSEngine::getExitOf(Item *item, uint16 d) { return subRoom->roomExit[d]; } +void AGOSEngine::moveDirn(Item *i, int x) { + Item *d; + uint16 n; + + if (i->parent == 0) + return; + + n = getExitOf(derefItem(i->parent), x); + if (derefItem(n) == NULL) { + loadRoomItems(n); + n=getExitOf(derefItem(i->parent), x); + } + + d = derefItem(n); + if (d) { + n = getDoorState(derefItem(i->parent), x); + if(n == 1) { + if(!canPlace(i,d)) + setItemParent(i,d); + } + } +} + bool AGOSEngine::loadRoomItems(uint item) { byte *p; uint i, min_num, max_num; -- cgit v1.2.3