Skip to content

Commit

Permalink
MoveRoute - Support Variables as Event ID (Maniac patch feature)
Browse files Browse the repository at this point in the history
Tiny update based on @MackValentine's code.

In MP, Move Route supports using variables as the target event ID:

```js
//TPC SYNTAX:

v[1] = 2
@ev[v[1]].setAction .freq 8 .unskippable .act {
    .moveDown
}
```

Co-Authored-By: MackValentine <[email protected]>
  • Loading branch information
jetrotal and MackValentine committed Dec 19, 2024
1 parent edec538 commit bcbffb8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3049,7 +3049,11 @@ 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 +3069,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 bcbffb8

Please sign in to comment.