Closed DakinQuelia closed 3 years ago
Hello.
It's not your code. It appears to be a bug in Quest. I checked an openable item in my own game, and it did the same thing.
When I add this code to my settings.setup
function, it seems to fix the problem.
OPENABLE_DICTIONARY.close = function(isMultiple, char) {
const tpParams = {char:char, container:this}
if (!this.openable) {
msg(prefix(this, isMultiple) + lang.cannot_close, tpParams);
return false;
}
else if (this.closed) {
msg(prefix(this, isMultiple) + lang.already, {item:this});
return false;
}
//this.hereVerbs = ['Examine', 'Open']; //KV commented out to fix bug.
this.closed = true;
this.closeMsg(isMultiple, tpParams);
if (this.onClose) this.onClose(char)
return true;
};
//-----------------------------------------------------------
//END OF FIX OPENABLE adding duplicate verbs onto pane items|
//-----------------------------------------------------------
If you don't already have a settings.setup
function in your code, open the file 'game/settings.js', and add this code:
settings.setup = function(){
OPENABLE_DICTIONARY.close = function(isMultiple, char) {
const tpParams = {char:char, container:this}
if (!this.openable) {
msg(prefix(this, isMultiple) + lang.cannot_close, tpParams);
return false;
}
else if (this.closed) {
msg(prefix(this, isMultiple) + lang.already, {item:this});
return false;
}
//this.hereVerbs = ['Examine', 'Open']; //KV commented out to fix bug.
this.closed = true;
this.closeMsg(isMultiple, tpParams);
if (this.onClose) this.onClose(char)
return true;
};
//-----------------------------------------------------------
//END OF FIX OPENABLE adding duplicate verbs onto pane items|
//-----------------------------------------------------------
}
Thank you very much. It's fixed.
A pull request maybe ?
A pull request maybe ?
ThePix will see this and either add my fix or add a better fix (usually the latter, ha-ha).
Also, I think my Linux line-breaks mess up the existing files, which have Windows line-breaks.
Either way, ThePix usually has a better fix. (Hey! That rhymed!)
Have a good night! Or day, depending on where you are in the world!
Fixed. Thanks Dakin for spotting and KV for the fix (that was the best solution)
Hello,
I've a little problem with my code :
It displays TWO same options : https://i.goopics.net/ka8VG.png
Thanks per advance.