From b0a97d63ef4491fc94cd686a2a036cae882e72d1 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Mon, 14 Jun 2021 23:41:46 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20ne=20pas=20afficher=20qu'on=20re=C3=A7oi?= =?UTF-8?q?t=200=20deniers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/actor.js b/module/actor.js index f62ad86c..4d3012bb 100644 --- a/module/actor.js +++ b/module/actor.js @@ -3495,13 +3495,17 @@ export class RdDActor extends Actor { } async ajouterDeniers(gain, fromActorId = undefined) { + gain = Number.parseInt(gain); + if (gain == 0){ + return; + } if (fromActorId && !game.user.isGM) { RdDActor.remoteActorCall({ userId: Misc.connectedGMOrUser(), actorId: this.id, method: 'ajouterDeniers', args: [gain, fromActorId] }); } else { const fromActor = game.actors.get(fromActorId) let fortune = this.getFortune(); - fortune += Number(gain); + fortune += gain; await this.optimizeArgent(fortune); RdDAudio.PlayContextAudio("argent"); // Petit son