diff options
| -rw-r--r-- | saga/actor.cpp | 25 | ||||
| -rw-r--r-- | saga/actor.h | 4 | ||||
| -rw-r--r-- | saga/isomap.cpp | 6 | 
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;  | 
