Update for module support
This commit is contained in:
@ -8,7 +8,7 @@ export class BoLCommands {
|
||||
static init() {
|
||||
if (!game.bol.commands) {
|
||||
const bolCommands = new BoLCommands()
|
||||
bolCommands.registerCommand({ path: ["/adventure"], func: (content, msg, params) => BoLAdventureGenerator.createAdventure(), descr: "Nouvelle idée d'aventure!" });
|
||||
//bolCommands.registerCommand({ path: ["/adventure"], func: (content, msg, params) => BoLAdventureGenerator.createAdventure(), descr: "Nouvelle idée d'aventure!" });
|
||||
bolCommands.registerCommand({ path: ["/pcview"], func: (content, msg, params) => BoLCharacterSummary.displayPCSummary(), descr: "Affiche la liste des PJs!" });
|
||||
game.bol.commands = bolCommands
|
||||
}
|
||||
@ -88,7 +88,7 @@ export class BoLCommands {
|
||||
console.log("===> Processing command")
|
||||
let command = commandsTable[name];
|
||||
path = path + name + " ";
|
||||
if (command && command.subTable) {
|
||||
if (command?.subTable) {
|
||||
if (params[0]) {
|
||||
return this._processCommand(command.subTable, params[0], params.slice(1), content, msg, path)
|
||||
}
|
||||
@ -97,9 +97,9 @@ export class BoLCommands {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (command && command.func) {
|
||||
if (command?.func) {
|
||||
const result = command.func(content, msg, params);
|
||||
if (result == false) {
|
||||
if (!result) {
|
||||
BoLCommands._chatAnswer(msg, command.descr);
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user