H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
203 stars 80 forks source link

/look in pocket just showing /look #1492

Closed Hazado closed 10 months ago

Hazado commented 10 months ago

the Easter egg command "/look in pocket" just shows /look instead

ZarothYe commented 10 months ago

I think I see from the code why this is happening, give me a few days to get it fixed.

Mirphak commented 10 months ago

In xKIChat.py, the commands beginning by "/" are splited, so "/look in pocket" is understand as /look with parameters. image

ZarothYe commented 10 months ago

In xKIChat.py, the commands beginning by "/" are splited, so "/look in pocket" is understand as /look with parameters.

That's a good note, but /look in pocket is part of the kEasterEgg constant commands handled on 928 prior to the emote and /me handling that you're showing. I need to do more testing to be 100% sure, but I believe this is happening because in the iteration of checking well-known commands, it checks if the message starts with /look first instead of the more-specific /look in pocket. It may be as easy as re-ordering the commands in xKIConstants.py so that the /look in pocket command match is checked first. I'll try to submit something this weekend after testing locally.

Mirphak commented 10 months ago

You are right. I'm not sure how items in dictionary are read, maybe putting "/look in pocket" before "/look" will work? We may have to sort the dictionary?

Mirphak commented 10 months ago

With for command, function in reversed(commands.items()): I have that: image