diff --git a/src/core/event.cpp b/src/core/event.cpp index 74f9db35..e08d1a5e 100644 --- a/src/core/event.cpp +++ b/src/core/event.cpp @@ -31,6 +31,7 @@ Event* Event::createNewEvent(QString event_type, QString map_name, Project *proj Event *event = new Event; if (event_type == EventType::Object) { event = createNewObjectEvent(project); + event->setFrameFromMovement(event->get("movement_type")); } else if (event_type == EventType::Warp) { event = createNewWarpEvent(map_name); } else if (event_type == EventType::HealLocation) { diff --git a/src/editor.cpp b/src/editor.cpp index 4e3be878..00765fc4 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -1332,6 +1332,9 @@ void Editor::displayMapEvents() { scene->addItem(events_group); QList events = map->getAllEvents(); + for (Event *event : events) { + event->setFrameFromMovement(project->facingDirections.value(event->get("movement_type"))); + } project->loadEventPixmaps(events); for (Event *event : events) { addMapEvent(event); @@ -1344,8 +1347,7 @@ void Editor::displayMapEvents() { DraggablePixmapItem *Editor::addMapEvent(Event *event) { DraggablePixmapItem *object = new DraggablePixmapItem(event, this); - event->setFrameFromMovement(project->facingDirections.value(event->get("movement_type"))); - object->updatePixmap(); + this->redrawObject(object); if (!event->usingSprite) { object->setOpacity(0.7); }