Skip to content

Commit

Permalink
Merge pull request #3312 from EasyRPG-NewFeatures/Maniacs-MoveEventVa…
Browse files Browse the repository at this point in the history
…riable

MoveRoute - Support Variables as Event ID (Maniac patch feature)
  • Loading branch information
Ghabry authored Dec 21, 2024
2 parents 3bd1298 + 3e9874f commit b7dcfe6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3049,7 +3049,9 @@ bool Game_Interpreter::CommandPlayerVisibility(lcf::rpg::EventCommand const& com
}

bool Game_Interpreter::CommandMoveEvent(lcf::rpg::EventCommand const& com) { // code 11330
int event_id = com.parameters[0];
int event_id = ValueOrVariableBitfield(com.parameters[2], 2, com.parameters[0]);
int repeat = ManiacBitmask(com.parameters[2], 0x1);

Game_Character* event = GetCharacter(event_id);
if (event != NULL) {
// If the event is a vehicle in use, push the commands to the player instead
Expand All @@ -3065,7 +3067,7 @@ bool Game_Interpreter::CommandMoveEvent(lcf::rpg::EventCommand const& com) { //
move_freq = 6;
}

route.repeat = com.parameters[2] != 0;
route.repeat = repeat != 0;
route.skippable = com.parameters[3] != 0;

for (auto it = com.parameters.begin() + 4; it < com.parameters.end(); ) {
Expand Down

0 comments on commit b7dcfe6

Please sign in to comment.