Various fixes for spell and ranged attacks
This commit is contained in:
@@ -111,17 +111,16 @@ export default class D30Roll {
|
||||
if (externalType === "weapon-attack") {
|
||||
if (!weapon) {
|
||||
console.warn("D30Roll | Weapon object required for weapon-attack type")
|
||||
return this.ROLL_TYPES.MELEE_ATTACK // Default to melee
|
||||
// Fall through to use options.isRanged if available, otherwise default melee
|
||||
}
|
||||
return weapon.system?.weaponType === "ranged"
|
||||
return (options.isRanged || weapon?.system?.weaponType === "ranged")
|
||||
? this.ROLL_TYPES.RANGED_ATTACK
|
||||
: this.ROLL_TYPES.MELEE_ATTACK
|
||||
}
|
||||
|
||||
// Monster attacks - default to melee
|
||||
// Monster attacks - check options.isRanged (set from rollTarget.attackMode) or weapon type
|
||||
if (externalType === "monster-attack") {
|
||||
// Check if weapon object has range information
|
||||
if (weapon?.system?.weaponType === "ranged") {
|
||||
if (options.isRanged || weapon?.system?.weaponType === "ranged") {
|
||||
return this.ROLL_TYPES.RANGED_ATTACK
|
||||
}
|
||||
return this.ROLL_TYPES.MELEE_ATTACK
|
||||
|
||||
Reference in New Issue
Block a user