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

bescort fails if engaged during movement #4268

Closed
Ataelos opened this issue May 1, 2020 · 3 comments
Closed

bescort fails if engaged during movement #4268

Ataelos opened this issue May 1, 2020 · 3 comments

Comments

@Ataelos
Copy link

Ataelos commented May 1, 2020

https://pastebin.com/FxGdxmLP

If you are engaged before you can move out of the room, the last movement action is not registered by the script. This will cause an infinite loop.
This happens in any bescort area where you are immediately engaged at pole range, such as zaulfang swamp or gate of souls.

@vtcifer
Copy link
Contributor

vtcifer commented May 3, 2020

Issue appears to be a problem with def move in the core lich.rbw file.

It looks like the second retreat is triggering this elseif (likely incorrectly, but I don't know what the full string that is part of this regex is looking for)

     elsif line =~ /^You can't go there|^You can't (?:go|swim) in that direction\.|^Where are you trying to go\?|^What were you referring to\?|^I could not find what you were referring to\.|^How do you plan to do that here\?|^You take a few steps towards|^You cannot do that\.|^You settle yourself on|^You shouldn't annoy|^You can't go to|^That's probably not a very good idea|^Maybe you should look|^You are already|^You walk over to|^You step over to|The [\w\s]+ is too far away|You may not pass\.|become impassable\.|prevents you from entering\.|Please leave promptly\.|is too far above you to attempt that\.$|^Uh, yeah\.  Right\.$|^Definitely NOT a good idea\.$|^Your attempt fails|^There doesn't seem to be any way to do that at the moment\.$/
         echo 'move: failed'
         fill_hands if need_full_hands
         Script.current.downstream_buffer.unshift(save_stream)
         Script.current.downstream_buffer.flatten!
         return false

Specifically this line occurring right after the movement, even though it's part of the earlier retreat.

You are already as far away as you can get!

is matching

^You are already

Negative look-ahead should be able to fix it, if we don't know the full string that one part should be matching.

I don't know how updates can be applied to lich.rbw, as that's not part of this repo as far as I know.

@Ataelos
Copy link
Author

Ataelos commented May 3, 2020

https://pastebin.com/
This fixes one part of the issue, but there's still an issue with bescort looping. The wander_maze_until function isn't properly matching the exits line. Changing line 889 to
result = bput('look', 'Obvious (?:exits|paths):.*').split(':').last.split(', ').first.delete('.')
fixes this issue.
However, there is still an issue with wander_maze_until where it can infinite loop that I can't figure out.

@vtcifer
Copy link
Contributor

vtcifer commented Aug 26, 2021

Can probably be closed due to dragon-realms/dr-lich#60

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

No branches or pull requests

3 participants