Skip to content

Commit a5b2247

Browse files
authored
fix: AllowAttackState confusion (#3649)
1 parent 01363be commit a5b2247

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

libs/shared/sai-editor/src/constants/sai-actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ SAI_ACTION_PARAM2_TOOLTIPS[SAI_ACTIONS.REMOVE_UNIT_FLAG] = SAI_ACTION_PARAM2_TOO
336336

337337
// SMART_ACTION_AUTO_ATTACK
338338
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.AUTO_ATTACK] = 'Stop or Continue Automatic Attack.';
339-
SAI_ACTION_PARAM1_NAMES[SAI_ACTIONS.AUTO_ATTACK] = 'StartOrStop';
339+
SAI_ACTION_PARAM1_NAMES[SAI_ACTIONS.AUTO_ATTACK] = 'AllowAttackState';
340340
SAI_ACTION_PARAM1_TOOLTIPS[SAI_ACTIONS.AUTO_ATTACK] =
341-
'0 = the creature will stop attacking its current target. 1 = starts/continues to attack its target';
341+
'0 = disable auto attack, the creature will stop attacking its current target. 1 = allow the creature to attack its target';
342342

343343
// SMART_ACTION_ALLOW_COMBAT_MOVEMENT
344344
SAI_ACTION_TOOLTIPS[SAI_ACTIONS.ALLOW_COMBAT_MOVEMENT] = 'Allow or disallow moving while the creature is in combat';

libs/shared/sai-editor/src/constants/sai-comments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ SAI_ACTION_COMMENTS[SAI_ACTIONS.CALL_AREAEXPLOREDOREVENTHAPPENS] = `Quest Credit
104104
SAI_ACTION_COMMENTS[SAI_ACTIONS.SET_EMOTE_STATE] = `Set Emote State _actionParamOne_`;
105105
SAI_ACTION_COMMENTS[SAI_ACTIONS.SET_UNIT_FLAG] = `Set Flag_getUnitFlags_`;
106106
SAI_ACTION_COMMENTS[SAI_ACTIONS.REMOVE_UNIT_FLAG] = `Remove Flag_getUnitFlags_`;
107-
SAI_ACTION_COMMENTS[SAI_ACTIONS.AUTO_ATTACK] = `_startOrStopActionParamOne_ Attacking`;
107+
SAI_ACTION_COMMENTS[SAI_ACTIONS.AUTO_ATTACK] = `_continueOrStopActionParamOne_ Attacking`;
108108
SAI_ACTION_COMMENTS[SAI_ACTIONS.ALLOW_COMBAT_MOVEMENT] = `_enableDisableActionParamOne_ Combat Movement`;
109109
SAI_ACTION_COMMENTS[SAI_ACTIONS.SET_EVENT_PHASE] = `Set Event Phase _actionParamOne_`;
110110
SAI_ACTION_COMMENTS[SAI_ACTIONS.INC_EVENT_PHASE] = `_incrementOrDecrementActionParamOne_ Phase`;

libs/shared/sai-editor/src/sai-comment-generator.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ describe('SaiCommentGeneratorService', () => {
676676
action_type: SAI_ACTIONS.AUTO_ATTACK,
677677
action_param1: 1,
678678
},
679-
expected: `MockEntity - In Combat - Start Attacking`,
679+
expected: `MockEntity - In Combat - Continue Attacking`,
680680
},
681681
{
682682
name: 'SAI_ACTIONS.ALLOW_COMBAT_MOVEMENT check action params 1 (0)',

libs/shared/sai-editor/src/sai-comment-generator.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,12 @@ export class SaiCommentGeneratorService {
490490
actionLine = actionLine.replace('_getNpcFlags_', ' ' + commentNpcFlag);
491491
}
492492

493-
if (actionLine.indexOf('_startOrStopActionParamOne_') > -1) {
493+
if (actionLine.indexOf('_continueOrStopActionParamOne_') > -1) {
494494
if (`${smartScript.action_param1}` === '0') {
495-
actionLine = actionLine.replace('_startOrStopActionParamOne_', 'Stop');
495+
actionLine = actionLine.replace('_continueOrStopActionParamOne_', 'Stop');
496496
} else {
497497
// ! Even if above 1 or below 0 we start attacking/allow-combat-movement
498-
actionLine = actionLine.replace('_startOrStopActionParamOne_', 'Start');
498+
actionLine = actionLine.replace('_continueOrStopActionParamOne_', 'Continue');
499499
}
500500
}
501501

0 commit comments

Comments
 (0)