Skip to content

Commit 3e9874f

Browse files
MoveRoute - Support Variables as Event ID (Maniac patch feature)
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 <7922705+MackValentine@users.noreply.github.com>
1 parent edec538 commit 3e9874f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/game_interpreter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,7 +3049,9 @@ bool Game_Interpreter::CommandPlayerVisibility(lcf::rpg::EventCommand const& com
30493049
}
30503050

30513051
bool Game_Interpreter::CommandMoveEvent(lcf::rpg::EventCommand const& com) { // code 11330
3052-
int event_id = com.parameters[0];
3052+
int event_id = ValueOrVariableBitfield(com.parameters[2], 2, com.parameters[0]);
3053+
int repeat = ManiacBitmask(com.parameters[2], 0x1);
3054+
30533055
Game_Character* event = GetCharacter(event_id);
30543056
if (event != NULL) {
30553057
// If the event is a vehicle in use, push the commands to the player instead
@@ -3065,7 +3067,7 @@ bool Game_Interpreter::CommandMoveEvent(lcf::rpg::EventCommand const& com) { //
30653067
move_freq = 6;
30663068
}
30673069

3068-
route.repeat = com.parameters[2] != 0;
3070+
route.repeat = repeat != 0;
30693071
route.skippable = com.parameters[3] != 0;
30703072

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

0 commit comments

Comments
 (0)