mirror of
https://github.com/huderlem/porymap.git
synced 2026-04-24 06:48:08 -05:00
Fix crash when duplicating maps
This commit is contained in:
parent
ee986b8e56
commit
8f5880f5bd
|
|
@ -35,13 +35,8 @@ Map::Map(const Map &other, QObject *parent) : Map(parent) {
|
|||
|
||||
// Copy events
|
||||
for (auto i = other.m_events.constBegin(); i != other.m_events.constEnd(); i++) {
|
||||
QList<Event*> newEvents;
|
||||
for (const auto &event : i.value()) {
|
||||
auto newEvent = event->duplicate();
|
||||
m_ownedEvents.insert(newEvent);
|
||||
newEvents.append(newEvent);
|
||||
}
|
||||
m_events[i.key()] = newEvents;
|
||||
for (const auto &event : i.value())
|
||||
addEvent(event->duplicate());
|
||||
}
|
||||
|
||||
// Duplicating the map connections is probably not desirable, so we skip them.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user