@@ -515,7 +515,7 @@ void Interact()
515515 }
516516
517517 NetSendCmdLoc (MyPlayerId, true , myPlayer.UsesRangedWeapon () ? CMD_RATTACKXY : CMD_SATTACKXY, position);
518- LastMouseButtonAction = MouseActionType ::Attack;
518+ LastPlayerAction = PlayerActionType ::Attack;
519519 return ;
520520 }
521521
@@ -525,19 +525,19 @@ void Interact()
525525 } else {
526526 NetSendCmdParam1 (true , CMD_RATTACKID, pcursmonst);
527527 }
528- LastMouseButtonAction = MouseActionType ::AttackMonsterTarget;
528+ LastPlayerAction = PlayerActionType ::AttackMonsterTarget;
529529 return ;
530530 }
531531
532532 if (leveltype != DTYPE_TOWN && PlayerUnderCursor != nullptr && !myPlayer.friendlyMode ) {
533533 NetSendCmdParam1 (true , myPlayer.UsesRangedWeapon () ? CMD_RATTACKPID : CMD_ATTACKPID, PlayerUnderCursor->getId ());
534- LastMouseButtonAction = MouseActionType ::AttackPlayerTarget;
534+ LastPlayerAction = PlayerActionType ::AttackPlayerTarget;
535535 return ;
536536 }
537537
538538 if (ObjectUnderCursor != nullptr ) {
539539 NetSendCmdLoc (MyPlayerId, true , CMD_OPOBJXY, cursPosition);
540- LastMouseButtonAction = MouseActionType ::OperateObject;
540+ LastPlayerAction = PlayerActionType ::OperateObject;
541541 return ;
542542 }
543543}
@@ -1826,15 +1826,6 @@ void HandleRightStickMotion()
18261826 return ;
18271827 }
18281828
1829- if (AutomapActive) { // move map
1830- int dx = 0 ;
1831- int dy = 0 ;
1832- acc.Pool (&dx, &dy, 32 );
1833- AutomapOffset.deltaX += dy + dx;
1834- AutomapOffset.deltaY += dy - dx;
1835- return ;
1836- }
1837-
18381829 { // move cursor
18391830 InvalidateInventorySlot ();
18401831 int x = MousePosition.x ;
@@ -1899,7 +1890,7 @@ void plrctrls_after_check_curs_move()
18991890 }
19001891
19011892 // While holding the button down we should retain target (but potentially lose it if it dies, goes out of view, etc)
1902- if (ControllerActionHeld != GameActionType_NONE && IsNoneOf (LastMouseButtonAction, MouseActionType ::None, MouseActionType ::Attack, MouseActionType ::Spell)) {
1893+ if (ControllerActionHeld != GameActionType_NONE && IsNoneOf (LastPlayerAction, PlayerActionType ::None, PlayerActionType ::Attack, PlayerActionType ::Spell)) {
19031894 InvalidateTargets ();
19041895
19051896 if (pcursmonst == -1 && ObjectUnderCursor == nullptr && pcursitem == -1 && pcursinvitem == -1 && pcursstashitem == StashStruct::EmptyCell && PlayerUnderCursor == nullptr ) {
@@ -2100,11 +2091,11 @@ void PerformSpellAction()
21002091 UpdateSpellTarget (myPlayer._pRSpell );
21012092 CheckPlrSpell (false );
21022093 if (PlayerUnderCursor != nullptr )
2103- LastMouseButtonAction = MouseActionType ::SpellPlayerTarget;
2094+ LastPlayerAction = PlayerActionType ::SpellPlayerTarget;
21042095 else if (pcursmonst != -1 )
2105- LastMouseButtonAction = MouseActionType ::SpellMonsterTarget;
2096+ LastPlayerAction = PlayerActionType ::SpellMonsterTarget;
21062097 else
2107- LastMouseButtonAction = MouseActionType ::Spell;
2098+ LastPlayerAction = PlayerActionType ::Spell;
21082099}
21092100
21102101void CtrlUseInvItem ()
@@ -2187,7 +2178,7 @@ void PerformSecondaryAction()
21872178 NetSendCmdLocParam1 (true , CMD_GOTOAGETITEM, cursPosition, pcursitem);
21882179 } else if (ObjectUnderCursor != nullptr ) {
21892180 NetSendCmdLoc (MyPlayerId, true , CMD_OPOBJXY, cursPosition);
2190- LastMouseButtonAction = MouseActionType ::OperateObject;
2181+ LastPlayerAction = PlayerActionType ::OperateObject;
21912182 } else {
21922183 if (pcursmissile != nullptr ) {
21932184 MakePlrPath (myPlayer, pcursmissile->position .tile , true );
@@ -2204,7 +2195,7 @@ void PerformSecondaryAction()
22042195
22052196void QuickCast (size_t slot)
22062197{
2207- MouseActionType prevMouseButtonAction = LastMouseButtonAction ;
2198+ PlayerActionType prevMouseButtonAction = LastPlayerAction ;
22082199 Player &myPlayer = *MyPlayer;
22092200 SpellID spell = myPlayer._pSplHotKey [slot];
22102201 SpellType spellType = myPlayer._pSplTHotKey [slot];
@@ -2214,7 +2205,7 @@ void QuickCast(size_t slot)
22142205 }
22152206
22162207 CheckPlrSpell (false , spell, spellType);
2217- LastMouseButtonAction = prevMouseButtonAction;
2208+ LastPlayerAction = prevMouseButtonAction;
22182209}
22192210
22202211} // namespace devilution
0 commit comments