diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/bladerunner/actor.cpp | 12 | ||||
-rw-r--r-- | engines/bladerunner/actor_walk.cpp | 14 | ||||
-rw-r--r-- | engines/bladerunner/actor_walk.h | 2 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_load.cpp | 6 |
5 files changed, 30 insertions, 6 deletions
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp index a686722c8b..198762738f 100644 --- a/engines/bladerunner/actor.cpp +++ b/engines/bladerunner/actor.cpp @@ -137,6 +137,18 @@ void Actor::setup(int actorId) { for (int i = 0; i != actorCount; ++i) _friendlinessToOther[i] = 50; +#if BLADERUNNER_ORIGINAL_BUGS +#else + // if player actor was not idle and had an active _walkInfo then + // upon starting a new game, the player actpr wpi;d be put on the old _walkInfo + _walkInfo->reset(); +// // delete _walkInfo and re-allocate it (a reset method would probably be better) +// if (_walkInfo != nullptr) { +// delete(_walkInfo); +// } +// _walkInfo = new ActorWalk(_vm); +#endif // BLADERUNNER_ORIGINAL_BUGS + _combatInfo->setup(); _clues->removeAll(); _movementTrack->flush(); diff --git a/engines/bladerunner/actor_walk.cpp b/engines/bladerunner/actor_walk.cpp index f9abf6dc15..daa28b6350 100644 --- a/engines/bladerunner/actor_walk.cpp +++ b/engines/bladerunner/actor_walk.cpp @@ -38,16 +38,26 @@ namespace BladeRunner { ActorWalk::ActorWalk(BladeRunnerEngine *vm) { _vm = vm; + reset(); +} + +ActorWalk::~ActorWalk() {} + +// added method for bug fix (bad new game state for player actor) and better management of object +void ActorWalk::reset() { _walking = false; _running = false; _facing = -1; _status = 0; + _destination = Vector3(0.0f, 0.0f, 0.0f); + _originalDestination = Vector3(0.0f, 0.0f, 0.0f); + _current = Vector3(0.0f, 0.0f, 0.0f); + _next = Vector3(0.0f, 0.0f, 0.0f); + _nearActors.clear(); } -ActorWalk::~ActorWalk() {} - bool ActorWalk::setup(int actorId, bool runFlag, const Vector3 &from, const Vector3 &to, bool mustReach, bool *arrived) { Vector3 next; diff --git a/engines/bladerunner/actor_walk.h b/engines/bladerunner/actor_walk.h index c0cdd937c0..fb3bd2f63e 100644 --- a/engines/bladerunner/actor_walk.h +++ b/engines/bladerunner/actor_walk.h @@ -49,6 +49,8 @@ public: ActorWalk(BladeRunnerEngine *vm); ~ActorWalk(); + void reset(); // added method for bug fix (bad new game state for player actor) and better management of object + bool setup(int actorId, bool runFlag, const Vector3 &from, const Vector3 &to, bool mustReach, bool *arrived); void getCurrentPosition(int actorId, Vector3 *pos, int *facing) const; bool tick(int actorId, float stepDistance, bool flag); diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 794be44bb3..3d2a649dbc 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -325,7 +325,7 @@ Common::Error BladeRunnerEngine::run() { } // TODO: why is game starting new game here when everything is done in startup? // else { - // newGame(1); + // newGame(kGameDifficultyMedium); // } gameLoop(); diff --git a/engines/bladerunner/ui/kia_section_load.cpp b/engines/bladerunner/ui/kia_section_load.cpp index dac7bebb64..909f29b2b9 100644 --- a/engines/bladerunner/ui/kia_section_load.cpp +++ b/engines/bladerunner/ui/kia_section_load.cpp @@ -162,11 +162,11 @@ void KIASectionLoad::scrollBoxCallback(void *callbackData, void *source, int lin if (mouseButton == 0 && source == self->_scrollBox && lineData >= 0) { if (lineData == self->_newGameEasyLineId) { - self->_vm->newGame(0); + self->_vm->newGame(kGameDifficultyEasy); } else if (lineData == self->_newGameMediumLineId) { - self->_vm->newGame(1); + self->_vm->newGame(kGameDifficultyMedium); } else if (lineData == self->_newGameHardLineId) { - self->_vm->newGame(2); + self->_vm->newGame(kGameDifficultyHard); } else { self->_vm->loadGameState(self->_saveList[lineData].getSaveSlot()); } |