await ChatMessage.create
ChatMessage.create est async, il faut donc de préférence l'appeler avec un await. Des effets secondaires avaient lieu (ordre de messages, updates ultérieurs parfois pas pris en compte)
This commit is contained in:
@@ -168,7 +168,7 @@ export class Apprecier {
|
||||
|
||||
async rollMoral(moral = undefined) {
|
||||
if (this.raisons.length > 0) {
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.actor),
|
||||
content: 'Pas de jet de moral:' + Misc.concat(this.raisons.map(r => `<br> - ${r}`))
|
||||
})
|
||||
@@ -176,7 +176,6 @@ export class Apprecier {
|
||||
}
|
||||
|
||||
moral = moral ?? this.appreciation.moral
|
||||
// TODO: jet de moral
|
||||
await this.actor.jetDeMoral(moral, this.appreciation.bonmoment)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user