Fix camera instant movement bug in Dragonborne credits
@@ -282,8 +282,6 @@ UBYTE ScriptUpdate_Emote() {
}
UBYTE ScriptUpdate_MoveCamera() {
- // If camera is animating move towards location
- if ((camera_settings & CAMERA_TRANSITION_FLAG) == CAMERA_TRANSITION_FLAG) {
if ((game_time & camera_speed) == 0) {
if (camera_pos.x > camera_dest.x) {
camera_pos.x--;
@@ -302,16 +300,6 @@ UBYTE ScriptUpdate_MoveCamera() {
}
return TRUE;
}
- }
- // Otherwise jump imediately to camera destination
- else {
- camera_pos.x = camera_dest.x;
- camera_pos.y = camera_dest.y;
- if (after_lock_camera) {
- camera_settings = camera_settings | CAMERA_LOCK_FLAG;
- }
- return TRUE;
- }
return FALSE;
}
@@ -507,8 +495,13 @@ void Script_CameraMoveTo_b() {
ScriptHelper_ClampCamDest();
+ if ((camera_settings & CAMERA_TRANSITION_FLAG) == CAMERA_TRANSITION_FLAG) {
after_lock_camera = FALSE;
script_update_fn = ScriptUpdate_MoveCamera;
+ } else {
+ camera_pos.x = camera_dest.x;
+ camera_pos.y = camera_dest.y;
+ }
}
/*
@@ -526,8 +519,13 @@ void Script_CameraLock_b() {
ScriptHelper_ClampCamDest();
+ if ((camera_settings & CAMERA_TRANSITION_FLAG) == CAMERA_TRANSITION_FLAG) {
after_lock_camera = TRUE;
script_update_fn = ScriptUpdate_MoveCamera;
+ } else {
+ camera_pos.x = camera_dest.x;
+ camera_pos.y = camera_dest.y;
+ }
}
void ScriptHelper_ClampCamDest() {
