Fix inititiative rolls
All checks were successful
Release Creation / build (release) Successful in 52s
All checks were successful
Release Creation / build (release) Successful in 52s
This commit is contained in:
@@ -113,6 +113,16 @@ export default class LethalFantasyUtils {
|
||||
console.log(`handleSocketEvent !`, msg)
|
||||
let actor
|
||||
switch (msg.type) {
|
||||
case "applyDamage":
|
||||
if (game.user.isGM) {
|
||||
// Prefer the specific token actor (correct for unlinked monsters); fall back to world actor.
|
||||
actor = msg.tokenId
|
||||
? canvas.tokens?.placeables?.find(t => t.id === msg.tokenId)?.actor
|
||||
: (game.combat?.combatants?.find(c => c.actorId === msg.actorId)?.actor
|
||||
?? game.actors.get(msg.actorId))
|
||||
if (actor) actor.applyDamage(msg.damage)
|
||||
}
|
||||
break
|
||||
case "rollInitiative":
|
||||
actor = game.actors.get(msg.actorId)
|
||||
actor.system.rollInitiative(msg.combatId, msg.combatantId)
|
||||
|
||||
Reference in New Issue
Block a user