diff --git a/src/ff7/field/background.cpp b/src/ff7/field/background.cpp index af6f4fad..af98da14 100644 --- a/src/ff7/field/background.cpp +++ b/src/ff7/field/background.cpp @@ -571,6 +571,8 @@ namespace ff7::field void field_init_scripted_bg_movement() { vector2 world_pos; + short original_world_pos_y; + if ( !ff7_externals.modules_global_object->world_move_status ) { switch ( ff7_externals.modules_global_object->world_move_mode ) @@ -591,9 +593,12 @@ namespace ff7::field *ff7_externals.scripted_world_move_n_steps = ff7_externals.modules_global_object->field_20; *ff7_externals.scripted_world_move_step_index = 0; world_pos = {*ff7_externals.field_curr_delta_world_pos_x, *ff7_externals.field_curr_delta_world_pos_y}; + original_world_pos_y = world_pos.y; - if(is_fieldmap_wide()) + if(is_fieldmap_wide()) { ff7_field_clip_with_camera_range(&world_pos); + world_pos.y = original_world_pos_y; + } *ff7_externals.scripted_world_initial_pos_x = world_pos.x; *ff7_externals.scripted_world_initial_pos_y = world_pos.y; @@ -603,8 +608,12 @@ namespace ff7::field *ff7_externals.field_bg_flag_CC15E4 = 1; world_pos = {ff7_externals.modules_global_object->field_A, ff7_externals.modules_global_object->field_C}; - if(is_fieldmap_wide()) - field_widescreen_width_clip_with_camera_range(&world_pos); + original_world_pos_y = world_pos.y; + + if(is_fieldmap_wide()) { + ff7_field_clip_with_camera_range(&world_pos); + world_pos.y = original_world_pos_y; + } *ff7_externals.field_curr_delta_world_pos_x = world_pos.x; *ff7_externals.field_curr_delta_world_pos_y = world_pos.y; @@ -617,15 +626,23 @@ namespace ff7::field *ff7_externals.scripted_world_move_step_index = 0; world_pos = {*ff7_externals.field_curr_delta_world_pos_x, *ff7_externals.field_curr_delta_world_pos_y}; - if(is_fieldmap_wide()) - field_widescreen_width_clip_with_camera_range(&world_pos); + original_world_pos_y = world_pos.y; + + if(is_fieldmap_wide()) { + ff7_field_clip_with_camera_range(&world_pos); + world_pos.y = original_world_pos_y; + } *ff7_externals.scripted_world_initial_pos_x = world_pos.x; *ff7_externals.scripted_world_initial_pos_y = world_pos.y; world_pos = {ff7_externals.modules_global_object->field_A, ff7_externals.modules_global_object->field_C}; - if(is_fieldmap_wide()) - field_widescreen_width_clip_with_camera_range(&world_pos); + original_world_pos_y = world_pos.y; + + if(is_fieldmap_wide()) { + ff7_field_clip_with_camera_range(&world_pos); + world_pos.y = original_world_pos_y; + } *ff7_externals.scripted_world_final_pos_x = world_pos.x; *ff7_externals.scripted_world_final_pos_y = world_pos.y;