Fix: soins d'un joueur à l'autre
Les données dans rollData ne pouvaient pas être serialisées
This commit is contained in:
@@ -179,19 +179,24 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
return result
|
||||
}
|
||||
|
||||
async onRollTachePremiersSoins(blessureId, rollData, soigneurId) {
|
||||
async callbackPremiersSoins(blessureId, rollData, soigneurId) {
|
||||
await this.onRollTachePremiersSoins(blessureId,
|
||||
rollData.v2 ? rollData.current.tache.tache : rollData.tache,
|
||||
rollData.rolled.isETotal,
|
||||
soigneurId)
|
||||
}
|
||||
async onRollTachePremiersSoins(blessureId, tache, isETotal, soigneurId) {
|
||||
if (!this.isOwner) {
|
||||
return RdDBaseActor.remoteActorCall({
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
method: 'onRollTachePremiersSoins', args: [blessureId, rollData, soigneurId]
|
||||
method: 'onRollTachePremiersSoins', args: [blessureId, tache, isETotal, soigneurId]
|
||||
})
|
||||
}
|
||||
|
||||
const blessure = this.getItem(blessureId, 'blessure')
|
||||
if (blessure && !blessure.system.premierssoins.done) {
|
||||
const tache = rollData.v2 ? rollData.current.tache.tache : rollData.tache
|
||||
if (rollData.rolled.isETotal) {
|
||||
if (isETotal) {
|
||||
await blessure.update({
|
||||
'system.difficulte': blessure.system.difficulte - 1,
|
||||
'system.premierssoins.tache': Math.max(0, tache.system.points_de_tache_courant)
|
||||
|
||||
Reference in New Issue
Block a user