mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 12:39:56 +00:00
ULTIMA8: Fix Crusader robot control camera location
Previously we set the camera process to follow the robot, but it should snap to the robot's location and then use the SnapProcess to update location in chunks.
This commit is contained in:
parent
14288d8293
commit
167310867f
@ -39,6 +39,7 @@
|
||||
#include "ultima/ultima8/world/get_object.h"
|
||||
#include "ultima/ultima8/world/target_reticle_process.h"
|
||||
#include "ultima/ultima8/audio/audio_process.h"
|
||||
#include "ultima/ultima8/world/snap_process.h"
|
||||
|
||||
namespace Ultima {
|
||||
namespace Ultima8 {
|
||||
@ -508,17 +509,21 @@ void World::setAlertActiveRegret(bool active)
|
||||
void World::setControlledNPCNum(uint16 num) {
|
||||
uint16 oldnpc = _controlledNPCNum;
|
||||
_controlledNPCNum = num;
|
||||
CameraProcess::SetCameraProcess(new CameraProcess(num));
|
||||
Actor *previous = getActor(oldnpc);
|
||||
if (previous && !previous->isDead() && previous->isInCombat()) {
|
||||
previous->clearInCombat();
|
||||
}
|
||||
|
||||
Actor *controlled = getActor(num);
|
||||
if (controlled && num != 1) {
|
||||
Kernel::get_instance()->killProcesses(num, Kernel::PROC_TYPE_ALL, true);
|
||||
if (controlled->isInCombat())
|
||||
controlled->clearInCombat();
|
||||
if (controlled) {
|
||||
if (num != 1) {
|
||||
Kernel::get_instance()->killProcesses(num, Kernel::PROC_TYPE_ALL, true);
|
||||
if (controlled->isInCombat())
|
||||
controlled->clearInCombat();
|
||||
}
|
||||
int32 x, y, z;
|
||||
controlled->getCentre(x, y, z);
|
||||
CameraProcess::SetCameraProcess(new CameraProcess(x, y, z));
|
||||
}
|
||||
|
||||
TargetReticleProcess *t = TargetReticleProcess::get_instance();
|
||||
|
Loading…
Reference in New Issue
Block a user