Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quests doing geometry checks are not shown again after undo #4496

Closed
riQQ opened this issue Oct 13, 2022 · 9 comments
Closed

Quests doing geometry checks are not shown again after undo #4496

riQQ opened this issue Oct 13, 2022 · 9 comments
Labels

Comments

@riQQ
Copy link
Collaborator

riQQ commented Oct 13, 2022

How to Reproduce

Bonus

  • Hard quitting the app and restarting doesn't help
  • 'Scan for quest here' returns the quest

Expected Behavior
Quest comes back after undo

Versions affected
v47.1

@riQQ riQQ added the bug label Oct 13, 2022
@westnordost
Copy link
Member

@matkoniecz this is your quest, could you look into that?

@matkoniecz
Copy link
Member

matkoniecz commented Oct 14, 2022

Is there any other quest that is doing geometry checks and supporting undo? (entrance quest checks is it within building line and checks value of building= key and is also checking tags on footway line)

@westnordost
Copy link
Member

"Is there a crossing? " for example.

All quests support undo.

@matkoniecz
Copy link
Member

matkoniecz commented Oct 14, 2022

Looking at it:

    override fun isApplicableTo(element: Element): Boolean? =
        if (element !is Node || element.tags.isNotEmpty()) false else null

it seems that undone crossing quest will also disappear.

I also tested it and it actually happens: I solved quest, undid it and it has become missing.

So fixing this would require implementing doing geometry checks on undo.

@matkoniecz matkoniecz changed the title Entrance quest isn't shown again after undo Quest doing geometry checks are not shown again after undo Oct 14, 2022
@matkoniecz matkoniecz changed the title Quest doing geometry checks are not shown again after undo Quests doing geometry checks are not shown again after undo Oct 14, 2022
@westnordost
Copy link
Member

Eh, what are you on about? Don't you know what happens when that function returns null?

@Helium314
Copy link
Collaborator

Issue is that this is not valid for crossing and entrance quests:

/* shortcut: if the element has no tags, it is just part of the geometry of another
* element, so no need to check for quests for that element */
if (element.tags.isEmpty()) return@async null

@westnordost
Copy link
Member

Hm I think this can be removed without replacement, after all the quest filters already filter out elements with no tags fast

@westnordost
Copy link
Member

Thanks for the find, @Helium314

@matkoniecz
Copy link
Member

Eh, what are you on about? Don't you know what happens when that function returns null?

apparently not! I thought that it means that undo was not supported - but was unsure, so I tested it which seemed to confirm it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants