aboutsummaryrefslogtreecommitdiff
path: root/actor.cpp
diff options
context:
space:
mode:
authorVincent Hamm2002-03-06 09:40:21 +0000
committerVincent Hamm2002-03-06 09:40:21 +0000
commit474c9e333b81280e2c450f07e81eb1cc19ea89b5 (patch)
treea1bfb15807fb807855953d385f2313117cdf88a9 /actor.cpp
parentc7d58aca8485eff7309af22eefee6398ce136159 (diff)
downloadscummvm-rg350-474c9e333b81280e2c450f07e81eb1cc19ea89b5.tar.gz
scummvm-rg350-474c9e333b81280e2c450f07e81eb1cc19ea89b5.tar.bz2
scummvm-rg350-474c9e333b81280e2c450f07e81eb1cc19ea89b5.zip
Reimplemented the preliminary Dig features. Implemented actor with many direction. Fixed bomp bug
svn-id: r3661
Diffstat (limited to 'actor.cpp')
-rw-r--r--actor.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/actor.cpp b/actor.cpp
index 3d858d8991..f933818e6c 100644
--- a/actor.cpp
+++ b/actor.cpp
@@ -21,6 +21,7 @@
#include "stdafx.h"
#include "scumm.h"
+#include "math.h"
void Scumm::initActor(Actor *a, int mode) {
if (mode==1) {
@@ -153,8 +154,14 @@ int Scumm::calcMovementFactor(Actor *a, int newX, int newY) {
a->walkdata.YXFactor = YXFactor;
a->walkdata.xfrac = 0;
a->walkdata.yfrac = 0;
-
- a->newDirection = getAngleFromPos(XYFactor, YXFactor);
+
+ if(_gameId==GID_DIG) {
+ float temp;
+ temp = atan2 (XYFactor, -YXFactor);
+ a->newDirection = normalizeAngle(temp * 1.8e2 / 3.14);
+ } else {
+ a->newDirection = getAngleFromPos(XYFactor, YXFactor);
+ }
return actorWalkStep(a);
}