Fix an occasional crash when starting to drag an entity.

pull/168/head
EvilSpirit 2017-01-20 10:12:45 +07:00 committed by whitequark
parent 86f229c5e6
commit 119b17ac75
1 changed files with 6 additions and 1 deletions

View File

@ -72,7 +72,12 @@ void GraphicsWindow::StartDraggingBySelection() {
// The user might select a point, and then click it again to start
// dragging; but the point just got unselected by that click. So drag
// the hovered item too, and they'll always have it.
if(hover.entity.v) StartDraggingByEntity(ChooseFromHoverToDrag().entity);
if(hover.entity.v) {
hEntity dragEntity = ChooseFromHoverToDrag().entity;
if(dragEntity.v != Entity::NO_ENTITY.v) {
StartDraggingByEntity(dragEntity);
}
}
}
void GraphicsWindow::MouseMoved(double x, double y, bool leftDown,