MCPcopy Create free account
hub / github.com/EasyRPG/Player / CommandChangeEventLocation

Method CommandChangeEventLocation

src/game_interpreter.cpp:2292–2313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2290}
2291
2292bool Game_Interpreter::CommandChangeEventLocation(lcf::rpg::EventCommand const& com) { // Code 10860
2293 int event_id = com.parameters[0];
2294 Game_Character *event = GetCharacter(event_id, "ChangeEventLocation");
2295 if (event != nullptr) {
2296 const auto x = ValueOrVariable(com.parameters[1], com.parameters[2]);
2297 const auto y = ValueOrVariable(com.parameters[1], com.parameters[3]);
2298 event->MoveTo(event->GetMapId(), x, y);
2299
2300 // RPG2k3 feature
2301 int direction = -1;
2302 if (Player::IsRPG2k3Commands() && com.parameters.size() > 4) {
2303 direction = com.parameters[4] - 1;
2304 }
2305
2306 // Only for the constant case, not for variables
2307 if (com.parameters[1] == 0 && direction != -1) {
2308 event->SetDirection(direction);
2309 event->UpdateFacing();
2310 }
2311 }
2312 return true;
2313}
2314
2315bool Game_Interpreter::CommandTradeEventLocations(lcf::rpg::EventCommand const& com) { // Code 10870
2316 int event1_id = com.parameters[0];

Callers

nothing calls this directly

Calls 5

SetDirectionMethod · 0.80
UpdateFacingMethod · 0.80
MoveToMethod · 0.45
GetMapIdMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected