diff --git a/module/actor.js b/module/actor.js index f62ad86c..d30d2b72 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 @@ -3590,7 +3594,7 @@ export class RdDActor extends Actor { if (!vente.quantiteIllimite) { if (vente.quantiteNbLots <= achat.nombreLots) { - ChatUtility.removeChatMessageId(chatMessageIdVente); + ChatUtility.removeChatMessageId(achat.chatMessageIdVente); } else { vente["properties"] = new RdDItem(vente.item).getProprietes(); diff --git a/system.json b/system.json index 137f7ff0..7811de3c 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "1.4.32", + "version": "1.4.33", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.8.0", "compatibleCoreVersion": "0.8.99", diff --git a/templates/chat-vente-item.html b/templates/chat-vente-item.html index 04ef2f24..c4774436 100644 --- a/templates/chat-vente-item.html +++ b/templates/chat-vente-item.html @@ -17,7 +17,7 @@ {{#if (gt tailleLot 1)}} Lots de: {{tailleLot}}
{{/if}} - {{#if prixLot}} + {{#if (ne prixLot 0)}} Prix {{#if (gt tailleLot 1)}}du lot {{else}}unitaire{{/if}}: {{prixLot}} Sols
{{/if}} @@ -31,6 +31,6 @@ data-quantiteNbLots="{{quantiteNbLots}}" data-quantiteIllimite="{{#if quantiteIllimite}}true{{else}}false{{/if}}" data-prixLot="{{prixLot}}"> - {{#if prixLot}}Acheter{{else}}Prendre{{/if}} + {{#if (eq prixLot 0)}}Prendre{{else}}Acheter{{/if}}