From ffd7b0b0c1da7bd26636bc55f7d7cb4be013ceb7 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 14 Mar 2021 12:53:45 +0100 Subject: [PATCH] =?UTF-8?q?/tmra=20renvoie=20une=20tmr=20al=C3=A9atoire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/rdd-commands.js b/module/rdd-commands.js index b085c758..3c01d0a2 100644 --- a/module/rdd-commands.js +++ b/module/rdd-commands.js @@ -32,7 +32,7 @@ export class RdDCommands { rddCommands.registerCommand({ path: ["/nom"], func: (content, msg, params) => RdDNameGen.getName(msg, params), descr: "Génère un nom aléatoire" }); rddCommands.registerCommand({ - path: ["/tmra"], func: (content, msg, params) => rddCommands.getTMRAleatoire(msg, params), + path: ["/tmra"], func: (content, msg, params) => rddCommands.getTMRAleatoire(msg, params), descr: `Tire une case aléatoire des Terres médianes
/tmra forêt détermine une 'forêt' aléatoire
/tmra détermine une case aléatoire dans toutes les TMR` }); @@ -241,7 +241,7 @@ export class RdDCommands { getTMRAleatoire(msg, params) { if (params.length < 2) { let type = params[0]; - const tmr = TMRUtility.getTMRAleatoire(it => it.type == type); + const tmr = TMRUtility.getTMRAleatoire(type ? (it => it.type == type) : (it => true)); RdDCommands._chatAnswer(msg, `Case aléatoire: ${tmr.coord} - ${tmr.label}`); } else {