|
|
|
|
@ -200,7 +200,7 @@ void FindItemOrObject()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rotations = newRotations; |
|
|
|
|
pcursobj = object->GetId(); |
|
|
|
|
ObjectUnderCursor = object; |
|
|
|
|
cursPosition = targetPosition; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -417,7 +417,7 @@ void FindTrigger()
|
|
|
|
|
int rotations = 0; |
|
|
|
|
int distance = 0; |
|
|
|
|
|
|
|
|
|
if (pcursitem != -1 || pcursobj != -1) |
|
|
|
|
if (pcursitem != -1 || ObjectUnderCursor != nullptr) |
|
|
|
|
return; // Prefer showing items/objects over triggers (use of cursm* conflicts)
|
|
|
|
|
|
|
|
|
|
for (auto &missile : Missiles) { |
|
|
|
|
@ -521,7 +521,7 @@ void Interact()
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pcursobj != -1) { |
|
|
|
|
if (ObjectUnderCursor != nullptr) { |
|
|
|
|
NetSendCmdLoc(MyPlayerId, true, CMD_OPOBJXY, cursPosition); |
|
|
|
|
LastMouseButtonAction = MouseActionType::OperateObject; |
|
|
|
|
return; |
|
|
|
|
@ -1624,7 +1624,7 @@ void plrctrls_after_check_curs_move()
|
|
|
|
|
if (ControllerButtonHeld != ControllerButton_NONE && IsNoneOf(LastMouseButtonAction, MouseActionType::None, MouseActionType::Attack, MouseActionType::Spell)) { |
|
|
|
|
InvalidateTargets(); |
|
|
|
|
|
|
|
|
|
if (pcursmonst == -1 && pcursobj == -1 && pcursitem == -1 && pcursinvitem == -1 && pcursstashitem == uint16_t(-1) && pcursplr == -1) { |
|
|
|
|
if (pcursmonst == -1 && ObjectUnderCursor == nullptr && pcursitem == -1 && pcursinvitem == -1 && pcursstashitem == uint16_t(-1) && pcursplr == -1) { |
|
|
|
|
FindTrigger(); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
@ -1634,7 +1634,7 @@ void plrctrls_after_check_curs_move()
|
|
|
|
|
pcursplr = -1; |
|
|
|
|
pcursmonst = -1; |
|
|
|
|
pcursitem = -1; |
|
|
|
|
pcursobj = -1; |
|
|
|
|
ObjectUnderCursor = nullptr; |
|
|
|
|
|
|
|
|
|
pcursmissile = nullptr; |
|
|
|
|
pcurstrig = -1; |
|
|
|
|
@ -1879,7 +1879,7 @@ void PerformSpellAction()
|
|
|
|
|
const Player &myPlayer = *MyPlayer; |
|
|
|
|
int spl = myPlayer._pRSpell; |
|
|
|
|
if ((pcursplr == -1 && (spl == SPL_RESURRECT || spl == SPL_HEALOTHER)) |
|
|
|
|
|| (pcursobj == -1 && spl == SPL_DISARM)) { |
|
|
|
|
|| (ObjectUnderCursor == nullptr && spl == SPL_DISARM)) { |
|
|
|
|
myPlayer.Say(HeroSpeech::ICantCastThatHere); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
@ -1972,7 +1972,7 @@ void PerformSecondaryAction()
|
|
|
|
|
|
|
|
|
|
if (pcursitem != -1) { |
|
|
|
|
NetSendCmdLocParam1(true, CMD_GOTOAGETITEM, cursPosition, pcursitem); |
|
|
|
|
} else if (pcursobj != -1) { |
|
|
|
|
} else if (ObjectUnderCursor != nullptr) { |
|
|
|
|
NetSendCmdLoc(MyPlayerId, true, CMD_OPOBJXY, cursPosition); |
|
|
|
|
LastMouseButtonAction = MouseActionType::OperateObject; |
|
|
|
|
} else { |
|
|
|
|
|