Skip to content

Commit

Permalink
FF7: Emulate the run behavior only if the player didn't ask for it al…
Browse files Browse the repository at this point in the history
…ready
  • Loading branch information
julianxhokaxhiu committed Feb 5, 2023
1 parent a1c5b0a commit d02ecd3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ff7/field/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,20 @@ namespace ff7::field

void ff7_field_update_models_position(int key_input_status)
{
if (gamepad_analogue_intent == INTENT_RUN)
bool emulate_run = !(ff7_externals.modules_global_object->current_key_input_status & 0x40) && gamepad_analogue_intent == INTENT_RUN;

if (emulate_run)
{
key_input_status |= 0x40;
ff7_externals.modules_global_object->current_key_input_status |= 0x40;
}

((void(*)(int))ff7_externals.field_update_models_positions)(key_input_status);

if (gamepad_analogue_intent == INTENT_RUN)
if (emulate_run)
{
key_input_status &= ~0x40;
ff7_externals.modules_global_object->current_key_input_status &= ~0x40;
if (emulate_run) ff7_externals.modules_global_object->current_key_input_status &= ~0x40;
}

for(int model_idx = 0; model_idx < (int)(*ff7_externals.field_n_models); model_idx++)
Expand Down

0 comments on commit d02ecd3

Please sign in to comment.