Closed KVonGit closed 3 years ago
PS
Also see this: Quest 6: HACK - Adding the OOPS command to v0.3
It seems to involve the same parser functions, but I didn't know that while hacking TAKE ALL.
Only had time to take a quick look. It is a bug. The bit that should deal with it is lines 281 to 285 in _parse.js. That works for DROP ALL, and it is not obvious why it does not for GET ALL.
I'll take a shot.
How do I see the parser.msg
output?
I have settings.playMode
on "dev", but none of the commands work (PARSER, INSPECT \
https://github.com/ThePix/QuestJS/wiki/Debugging#debugging-commands
The only thing that works for me is the walkthrough, and it works perfectly.
EDIT
I found the parser.debug
setting.
OK...
I removed my "fix" and moved one block of code down a few lines.
I moved this:
if (list.length === 0) {
res.error = cmd.nothingForAll ? cmd.nothingForAll : lang.nothing_msg;
res.score = -1;
return res;
}
It was lines 281 - 285.
I moved it to what is currently line 300.
list = list.filter(function(el) { return !exclude.includes(el); }); //This was line 299 before KV moved the next block.
if (list.length === 0) { //KV moved this here to fix TAKE ALL
res.error = cmd.nothingForAll ? cmd.nothingForAll : lang.nothing_msg; //KV moved this here to fix TAKE ALL
res.score = -1; //KV moved this here to fix TAKE ALL
return res; //KV moved this here to fix TAKE ALL
} //KV moved this here to fix TAKE ALL
if (list.length > 1 && !cmd.objects[i].multiple) {
res.error = no_multiples_msg;
res.score = -1;
return res;
}
Thanks, that looks to fix it. The message is not ideal, but is obviously trying to catch all situations.
When there is nothing at all to take and the player enters TAKE ALL, there is no response at all.
EXAMPLE 1
)
This seems to temporarily patch that:
EXAMPLE 2