aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorAndrew Kurushin2005-06-12 15:58:37 +0000
committerAndrew Kurushin2005-06-12 15:58:37 +0000
commit802780619a3c3e3bf6485d14ba40bfc7ab33b57c (patch)
tree9d0c07a178bd947de4e124ddd2cc97b9c3d67a4b /saga
parent001d14cf696c58c3d8b1a4cdcb07eb4497e87dbf (diff)
downloadscummvm-rg350-802780619a3c3e3bf6485d14ba40bfc7ab33b57c.tar.gz
scummvm-rg350-802780619a3c3e3bf6485d14ba40bfc7ab33b57c.tar.bz2
scummvm-rg350-802780619a3c3e3bf6485d14ba40bfc7ab33b57c.zip
fix Hooneyfoot bug
svn-id: r18379
Diffstat (limited to 'saga')
-rw-r--r--saga/actor.cpp25
-rw-r--r--saga/actor.h4
-rw-r--r--saga/isomap.cpp6
3 files changed, 17 insertions, 18 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp
index 6087bbaab8..f49176601d 100644
--- a/saga/actor.cpp
+++ b/saga/actor.cpp
@@ -461,7 +461,7 @@ void Actor::realLocation(Location &location, uint16 objectId, uint16 walkFlags)
void Actor::actorFaceTowardsPoint(uint16 actorId, const Location &toLocation) {
ActorData *actor;
Location delta;
- debug (8, "Actor::actorFaceTowardsPoint actorId=%i", actorId);
+ //debug (8, "Actor::actorFaceTowardsPoint actorId=%i", actorId);
actor = getActor(actorId);
toLocation.delta(actor->location, delta);
@@ -576,7 +576,11 @@ void Actor::updateActorsScene(int actorsEntrance) {
_protagonist = NULL;
for (i = 0; i < _actorsCount; i++) {
- actor = _actors[i];
+ actor = _actors[i];
+ actor->inScene = false;
+ if (actor->disabled) {
+ continue;
+ }
if ((actor->flags & (kProtagonist | kFollower)) || (i == 0)) {
if (actor->flags & kProtagonist) {
@@ -591,6 +595,7 @@ void Actor::updateActorsScene(int actorsEntrance) {
actor->sceneNumber = _vm->_scene->currentSceneNumber();
}
if (actor->sceneNumber == _vm->_scene->currentSceneNumber()) {
+ actor->inScene = true;
actor->actionCycle = (_vm->_rnd.getRandomNumber(7) & 0x7) * 4; // 1/8th chance
}
}
@@ -813,10 +818,7 @@ void Actor::handleActions(int msec, bool setup) {
for (i = 0; i < _actorsCount; i++) {
actor = _actors[i];
- if (actor->disabled)
- continue;
-
- if (actor->sceneNumber != _vm->_scene->currentSceneNumber())
+ if (!actor->inScene)
continue;
//todo: dragon stuff
@@ -1255,13 +1257,11 @@ void Actor::createDrawOrderList() {
_drawOrderList.clear();
for (i = 0; i < _actorsCount; i++) {
actor = _actors[i];
- if (actor->disabled)
+ if (!actor->inScene)
continue;
- if (i == 0 || actor->flags & (kFollower | kProtagonist) || actor->sceneNumber == _vm->_scene->currentSceneNumber()) {
- _drawOrderList.pushBack(actor, compareFunction);
- calcScreenPosition(actor);
- }
+ _drawOrderList.pushBack(actor, compareFunction);
+ calcScreenPosition(actor);
}
for (i = 0; i < _objsCount; i++) {
@@ -1649,8 +1649,7 @@ bool Actor::actorWalkTo(uint16 actorId, const Location &toLocation) {
for (i = 0; (i < _actorsCount) && (_barrierCount < ACTOR_BARRIERS_MAX); i++) {
anotherActor = _actors[i];
- if (anotherActor->disabled) continue;
- if (anotherActor->sceneNumber != _vm->_scene->currentSceneNumber()) continue;
+ if (!anotherActor->inScene) continue;
if (anotherActor == actor ) continue;
diff --git a/saga/actor.h b/saga/actor.h
index 00f950bd23..e1ebbb61cb 100644
--- a/saga/actor.h
+++ b/saga/actor.h
@@ -274,7 +274,9 @@ public:
int frameListResourceId; // Actor's frame list resource id
byte speechColor; // Actor dialogue color
-
+ //
+ bool inScene;
+
//variables
uint16 actorFlags; // dynamic flags
int32 currentAction; // ActorActions type
diff --git a/saga/isomap.cpp b/saga/isomap.cpp
index 83c2ff3587..ad5cdf1934 100644
--- a/saga/isomap.cpp
+++ b/saga/isomap.cpp
@@ -1151,8 +1151,7 @@ void IsoMap::placeOnTileMap(const Location &start, Location &result, int16 dista
for (i = 0; i < _vm->_actor->_actorsCount; i++) {
actor = _vm->_actor->_actors[i];
- if (actor->disabled) continue;
- if (actor->sceneNumber != _vm->_scene->currentSceneNumber()) continue;
+ if (!actor->inScene) continue;
u = (actor->location.u() >> 4) - uBase;
v = (actor->location.v() >> 4) - vBase;
@@ -1255,8 +1254,7 @@ void IsoMap::findTilePath(ActorData* actor, const Location &start, const Locatio
(_vm->_scene->currentSceneResourceId() != RID_ITE_OVERMAP_SCENE)) {
for (i = 0; i < _vm->_actor->_actorsCount; i++) {
other = _vm->_actor->_actors[i];
- if (other->disabled) continue;
- if (other->sceneNumber != _vm->_scene->currentSceneNumber()) continue;
+ if (!other->inScene) continue;
if (other==actor) continue;
u = (other->location.u() >> 4) - uBase;