aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2013-12-08 15:11:41 +0200
committerEugene Sandulenko2013-12-08 16:58:49 +0200
commit2d6abd8f0310cc7e3e1bf301610495b12c400aad (patch)
treee46c6e7943e17946761bc96d2c390b8ee93c398b
parentdbfaac22ed69d7b50021b6caec79d24c815804c1 (diff)
downloadscummvm-rg350-2d6abd8f0310cc7e3e1bf301610495b12c400aad.tar.gz
scummvm-rg350-2d6abd8f0310cc7e3e1bf301610495b12c400aad.tar.bz2
scummvm-rg350-2d6abd8f0310cc7e3e1bf301610495b12c400aad.zip
FULLPIPE: Implement MctlLadder::collisionDetection()
-rw-r--r--engines/fullpipe/motion.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 30f71aa0b3..978ef3ac48 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -201,9 +201,22 @@ MctlLadder::~MctlLadder() {
}
int MctlLadder::collisionDetection(StaticANIObject *man) {
- warning("STUB: MctlLaddercollisionDetection()");
+ if (findObjectPos(man) < 0)
+ return 0;
- return 0;
+ double delta;
+
+ if ((double)(man->_oy - _ladder_field_10) / (double)_ladder_field_1C < 0.0)
+ delta = -0.5;
+ else
+ delta = 0.5;
+
+ int res = (int)((double)(man->_oy - _ladder_field_10) / (double)_ladder_field_1C + delta);
+
+ if (res < 0)
+ return 0;
+
+ return res;
}
void MctlLadder::addObject(StaticANIObject *obj) {