aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/rooms.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-11-06 13:59:11 +0000
committerTravis Howell2006-11-06 13:59:11 +0000
commit415ec670564a328a67648ddae7c42a7142a2f053 (patch)
treeeccf1e0493e7fb0825c66aceb699ece2b64ad1f6 /engines/agos/rooms.cpp
parent8ef5e88323972fa8d2fe5e376c78a1903535f50a (diff)
downloadscummvm-rg350-415ec670564a328a67648ddae7c42a7142a2f053.tar.gz
scummvm-rg350-415ec670564a328a67648ddae7c42a7142a2f053.tar.bz2
scummvm-rg350-415ec670564a328a67648ddae7c42a7142a2f053.zip
Cleanup
svn-id: r24639
Diffstat (limited to 'engines/agos/rooms.cpp')
-rw-r--r--engines/agos/rooms.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index 3612a63d15..bd66d43722 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -124,7 +124,7 @@ void AGOSEngine::setDoorState(Item *i, uint16 d, uint16 n) {
}
// Elvira 1 specific
-uint16 AGOSEngine::getDoorOf(Item *i, uint16 d) {
+Item *AGOSEngine::getDoorOf(Item *i, uint16 d) {
SubGenExit *g;
Item *x;
@@ -137,10 +137,10 @@ uint16 AGOSEngine::getDoorOf(Item *i, uint16 d) {
return 0;
if (isRoom(x))
return 0;
- return itemPtrToID(x);
+ return x;
}
-uint16 AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
+Item *AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
SubGenExit *g;
Item *x;
@@ -152,24 +152,22 @@ uint16 AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
if (x == NULL)
return 0;
if (isRoom(x))
- return itemPtrToID(x);
+ return x;
if (x->state != 0)
return 0;
- return x->parent;
+ return derefItem(x->parent);
}
void AGOSEngine::moveDirn_e1(Item *i, uint x) {
Item *d, *p;
- uint16 n;
- if (i->parent == 0)
+ p = derefItem(i->parent);
+ if (p == 0)
return;
- p = derefItem(i->parent);
- n = getExitOf_e1(p, x);
- d = derefItem(n);
- if (n) {
+ d = getExitOf_e1(p, x);
+ if (d) {
if (canPlace(i, d))
return;
@@ -177,7 +175,7 @@ void AGOSEngine::moveDirn_e1(Item *i, uint x) {
return;
}
- d = derefItem(getDoorOf(p, x));
+ d = getDoorOf(p, x);
if (d) {
const byte *name = getStringPtrByID(d->itemName);
if (d->state == 1)