fix: ne pas afficher qu'on reçoit 0 deniers

This commit is contained in:
Vincent Vandemeulebrouck 2021-06-14 23:41:46 +02:00
parent 7253b35084
commit fa060a06a1
1 changed files with 5 additions and 1 deletions

View File

@ -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