Skip to content

Commit 266f0ff

Browse files
authored
Fix toUpperCase Attk error (#1906)
1 parent 74dcdec commit 266f0ff

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

AttackMaster/3.2.1/attackMaster.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2991,7 +2991,7 @@ var attackMaster = (function() {
29912991
* Build melee weapon attack macro
29922992
*/
29932993

2994-
var buildMWattkMacros = function( args, senderId, charCS, tableInfo, mwIndex, backstab=false ) {
2994+
var buildMWattkMacros = function( args, senderId, charCS, tableInfo, mwIndex, backstab=false ) { // toLowerCase()
29952995

29962996
return new Promise(resolve => {
29972997

@@ -3225,7 +3225,7 @@ var attackMaster = (function() {
32253225
setAbility( charCS, 'Do-not-use-DmgL-MW'+mwNumber, (parseMWattkMacro(args, charCS, attkType, addDmgMsg( dmgMacroDef.obj[1].body, dmgMsg, weapDmgMsg ))+attkMacro));
32263226
hitCharges = (hitCharges == '' ? 1 : hitCharges);
32273227
attkMacro = weapCharged && hitCharges ? ('\n!magic --mi-charges '+tokenID+'|-'+hitCharges+'|'+miName+'||'+weapCharged) : '';
3228-
attkMacro += ((weaponName !== miName) && attrLookup( charCS, fields.Items_reveal, fields.Items_table, miRowref ).toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+miRowref+'|silent') : '';
3228+
attkMacro += ((weaponName !== miName) && (attrLookup( charCS, fields.Items_reveal, fields.Items_table, miRowref ) || '').toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+miRowref+'|silent') : '';
32293229
attkMacro += weapCmd ? ('\n' + weapCmd) : '';
32303230
attkMacro += touchWeap ? ('\n!attk --blank-weapon '+tokenID+'|'+miName+'|silent') : '';
32313231
if (abilityType == Attk.TARGET) {
@@ -3551,8 +3551,8 @@ var attackMaster = (function() {
35513551
};
35523552
attkMacro += ((weapCharged && hitCharges) ? ('\n!magic --mi-charges '+tokenID+'|-'+hitCharges+'|'+miName+'|'+weapChgType) : '');
35533553
if (abilityType === Attk.TARGET) weapCmd = weapCmd.replace(/@{target\|.*?\|?token_id}/igm,'@{target|Select Target|token_id}');
3554-
attkMacro += ((weaponName !== miName) && attrLookup( charCS, fields.Items_reveal, fields.Items_table, miRowref ).toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+miRowref+'|silent') : '';
3555-
attkMacro += ((ammoName !== ammoMIname) && attrLookup( charCS, fields.Items_reveal, fields.Items_table, ammoRowref ).toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+ammoRowref+'|silent') : '';
3554+
attkMacro += ((weaponName !== miName) && (attrLookup( charCS, fields.Items_reveal, fields.Items_table, miRowref ) || '').toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+miRowref+'|silent') : '';
3555+
attkMacro += ((ammoName !== ammoMIname) && (attrLookup( charCS, fields.Items_reveal, fields.Items_table, ammoRowref ) || '').toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+ammoRowref+'|silent') : '';
35563556
attkMacro += weapCmd ? ('\n'+weapCmd) : '';
35573557
attkMacro += touchWeap ? ('\n!attk --blank-weapon '+tokenID+'|'+miName+'|silent') : '';
35583558
setAbility( charCS, 'Do-not-use-Attk-RW'+rwNumber+'-'+dist, attkMacro );

AttackMaster/attackMaster.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2991,7 +2991,7 @@ var attackMaster = (function() {
29912991
* Build melee weapon attack macro
29922992
*/
29932993

2994-
var buildMWattkMacros = function( args, senderId, charCS, tableInfo, mwIndex, backstab=false ) {
2994+
var buildMWattkMacros = function( args, senderId, charCS, tableInfo, mwIndex, backstab=false ) { // toLowerCase()
29952995

29962996
return new Promise(resolve => {
29972997

@@ -3225,7 +3225,7 @@ var attackMaster = (function() {
32253225
setAbility( charCS, 'Do-not-use-DmgL-MW'+mwNumber, (parseMWattkMacro(args, charCS, attkType, addDmgMsg( dmgMacroDef.obj[1].body, dmgMsg, weapDmgMsg ))+attkMacro));
32263226
hitCharges = (hitCharges == '' ? 1 : hitCharges);
32273227
attkMacro = weapCharged && hitCharges ? ('\n!magic --mi-charges '+tokenID+'|-'+hitCharges+'|'+miName+'||'+weapCharged) : '';
3228-
attkMacro += ((weaponName !== miName) && attrLookup( charCS, fields.Items_reveal, fields.Items_table, miRowref ).toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+miRowref+'|silent') : '';
3228+
attkMacro += ((weaponName !== miName) && (attrLookup( charCS, fields.Items_reveal, fields.Items_table, miRowref ) || '').toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+miRowref+'|silent') : '';
32293229
attkMacro += weapCmd ? ('\n' + weapCmd) : '';
32303230
attkMacro += touchWeap ? ('\n!attk --blank-weapon '+tokenID+'|'+miName+'|silent') : '';
32313231
if (abilityType == Attk.TARGET) {
@@ -3551,8 +3551,8 @@ var attackMaster = (function() {
35513551
};
35523552
attkMacro += ((weapCharged && hitCharges) ? ('\n!magic --mi-charges '+tokenID+'|-'+hitCharges+'|'+miName+'|'+weapChgType) : '');
35533553
if (abilityType === Attk.TARGET) weapCmd = weapCmd.replace(/@{target\|.*?\|?token_id}/igm,'@{target|Select Target|token_id}');
3554-
attkMacro += ((weaponName !== miName) && attrLookup( charCS, fields.Items_reveal, fields.Items_table, miRowref ).toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+miRowref+'|silent') : '';
3555-
attkMacro += ((ammoName !== ammoMIname) && attrLookup( charCS, fields.Items_reveal, fields.Items_table, ammoRowref ).toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+ammoRowref+'|silent') : '';
3554+
attkMacro += ((weaponName !== miName) && (attrLookup( charCS, fields.Items_reveal, fields.Items_table, miRowref ) || '').toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+miRowref+'|silent') : '';
3555+
attkMacro += ((ammoName !== ammoMIname) && (attrLookup( charCS, fields.Items_reveal, fields.Items_table, ammoRowref ) || '').toLowerCase() == 'use') ? ('\n!magic --button GM-ResetSingleMI|'+tokenID+'|'+ammoRowref+'|silent') : '';
35563556
attkMacro += weapCmd ? ('\n'+weapCmd) : '';
35573557
attkMacro += touchWeap ? ('\n!attk --blank-weapon '+tokenID+'|'+miName+'|silent') : '';
35583558
setAbility( charCS, 'Do-not-use-Attk-RW'+rwNumber+'-'+dist, attkMacro );

0 commit comments

Comments
 (0)