You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
anathemamask opened this issue
Feb 7, 2022
· 0 comments
Assignees
Labels
bugFunctionality which is not working as intendedcombatIssues related to Combat and the Combat TrackerdiceIssues related to dice rolling and the Dice system
When calling Combat.rollInitiative with parameter {messageOptions: {rollMode: "gmroll"}} the rollMode parameter is not honored and the initiative is rolled using game.settings.get("core", "rollMode") as a fallback.
Steps to reproduce
In any system, create an actor and a scene
Activate the scene, add the actor to the scene and begin combat with the token
The roll is performed as set in game.settings.get("core", "rollMode").
Analysis
The issue stems from the fact that Roll.toMessage with create = false parameter does not return an object that contains rollMode.
The issue does not happen, if Roll.toMessage is called with create = true.
When the messageData is created, it is populated with whisper attribute array, which is populated with user IDs to which the message must be whispered to. It does not contain rollMode attribute. It is then passed to the ChatMessage.implementation.create method, and eventually ChatMessage._preCreate will be called. The ChatMessage._preCreate method, when retrieving a roll message, expects for the messageData object to contain rollMode, but it does not.
As the Roll.toMessage method populates the messageData with the whisper attribute, I believe the ChatMessage._preCreate needs to be modified to use the whisper attribute, instead of rollMode in messageData.
The text was updated successfully, but these errors were encountered:
bugFunctionality which is not working as intendedcombatIssues related to Combat and the Combat TrackerdiceIssues related to dice rolling and the Dice system
Submitted via email
When calling
Combat.rollInitiative
with parameter{messageOptions: {rollMode: "gmroll"}}
therollMode
parameter is not honored and the initiative is rolled usinggame.settings.get("core", "rollMode")
as a fallback.Steps to reproduce
Expected behaviour
The roll is performed as a
gmroll
.Actual behaviour
The roll is performed as set in
game.settings.get("core", "rollMode")
.Analysis
The issue stems from the fact that
Roll.toMessage
withcreate = false
parameter does not return an object that containsrollMode
.The issue does not happen, if
Roll.toMessage
is called withcreate = true
.When the
messageData
is created, it is populated withwhisper
attribute array, which is populated with user IDs to which the message must be whispered to. It does not containrollMode
attribute. It is then passed to theChatMessage.implementation.create
method, and eventuallyChatMessage._preCreate
will be called. TheChatMessage._preCreate
method, when retrieving a roll message, expects for themessageData
object to containrollMode
, but it does not.As the
Roll.toMessage
method populates themessageData
with thewhisper
attribute, I believe theChatMessage._preCreate
needs to be modified to use thewhisper
attribute, instead ofrollMode
inmessageData
.The text was updated successfully, but these errors were encountered: