mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-15 13:26:53 -05:00
Properly read dynamically-set warps that use MAP_NONE as their destination
This commit is contained in:
@@ -1700,7 +1700,10 @@ void DraggablePixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *) {
|
||||
|
||||
void DraggablePixmapItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) {
|
||||
if (this->event->get("event_type") == EventType::Warp) {
|
||||
emit editor->warpEventDoubleClicked(this->event->get("destination_map_name"), this->event->get("destination_warp"));
|
||||
QString destMap = this->event->get("destination_map_name");
|
||||
if (destMap != NONE_MAP_NAME) {
|
||||
emit editor->warpEventDoubleClicked(this->event->get("destination_map_name"), this->event->get("destination_warp"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1010,6 +1010,10 @@ void Project::readMapGroups() {
|
||||
}
|
||||
}
|
||||
|
||||
mapConstantsToMapNames->insert(NONE_MAP_CONSTANT, NONE_MAP_NAME);
|
||||
mapNamesToMapConstants->insert(NONE_MAP_NAME, NONE_MAP_CONSTANT);
|
||||
maps->append(NONE_MAP_NAME);
|
||||
|
||||
groupNames = groups;
|
||||
groupedMapNames = groupedMaps;
|
||||
mapNames = maps;
|
||||
@@ -1473,6 +1477,11 @@ void Project::readMapEvents(Map *map) {
|
||||
warp->put("event_group_type", "warp_event_group");
|
||||
warp->put("event_type", EventType::Warp);
|
||||
map->events["warp_event_group"].append(warp);
|
||||
} else if (mapConstant == NONE_MAP_CONSTANT) {
|
||||
warp->put("destination_map_name", NONE_MAP_NAME);
|
||||
warp->put("event_group_type", "warp_event_group");
|
||||
warp->put("event_type", EventType::Warp);
|
||||
map->events["warp_event_group"].append(warp);
|
||||
} else {
|
||||
qDebug() << QString("Destination map constant '%1' is invalid for warp").arg(mapConstant);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user