Skip to content

Commit

Permalink
Clone Map Event: Store original event_id and map_id
Browse files Browse the repository at this point in the history
Fix #3347
  • Loading branch information
Ghabry committed Feb 23, 2025
1 parent a352759 commit a8f5437
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/game_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,13 @@ bool Game_Map::CloneMapEvent(int src_map_id, int src_event_id, int target_x, int
}), new_event);

auto game_event = Game_Event(GetMapId(), &*insert_it);
game_event.data()->easyrpg_clone_event_id = source_event->ID;
game_event.data()->easyrpg_clone_map_id = src_map_id;

events.insert(
std::upper_bound(events.begin(), events.end(), game_event, [](const auto& e, const auto& e2) {
return e.GetId() < e2.GetId();
}), Game_Event(GetMapId(), &*insert_it));
}), std::move(game_event));

UpdateUnderlyingEventReferences();

Expand Down

0 comments on commit a8f5437

Please sign in to comment.