|
|
|
|
@ -482,27 +482,30 @@ void FindTrigger()
|
|
|
|
|
CheckRportal(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Interact() |
|
|
|
|
bool IsStandingGround() |
|
|
|
|
{ |
|
|
|
|
if (leveltype == DTYPE_TOWN && pcursmonst != -1) { |
|
|
|
|
NetSendCmdLocParam1(true, CMD_TALKXY, Towners[pcursmonst].position, pcursmonst); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool stand = StandToggle; |
|
|
|
|
#ifndef USE_SDL1 |
|
|
|
|
if (ControlMode == ControlTypes::Gamepad) { |
|
|
|
|
ControllerButtonCombo standGroundCombo = sgOptions.Padmapper.ButtonComboForAction("StandGround"); |
|
|
|
|
stand = IsControllerButtonComboPressed(standGroundCombo); |
|
|
|
|
return StandToggle || IsControllerButtonComboPressed(standGroundCombo); |
|
|
|
|
} |
|
|
|
|
#ifndef USE_SDL1 |
|
|
|
|
if (ControlMode == ControlTypes::VirtualGamepad) { |
|
|
|
|
stand = VirtualGamepadState.standButton.isHeld; |
|
|
|
|
return VirtualGamepadState.standButton.isHeld; |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Interact() |
|
|
|
|
{ |
|
|
|
|
if (leveltype == DTYPE_TOWN && pcursmonst != -1) { |
|
|
|
|
NetSendCmdLocParam1(true, CMD_TALKXY, Towners[pcursmonst].position, pcursmonst); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Player &myPlayer = *MyPlayer; |
|
|
|
|
|
|
|
|
|
if (leveltype != DTYPE_TOWN && stand) { |
|
|
|
|
if (leveltype != DTYPE_TOWN && IsStandingGround()) { |
|
|
|
|
Direction pdir = myPlayer._pdir; |
|
|
|
|
AxisDirection moveDir = GetMoveDirection(); |
|
|
|
|
bool motion = moveDir.x != AxisDirectionX_NONE || moveDir.y != AxisDirectionY_NONE; |
|
|
|
|
@ -1303,15 +1306,11 @@ void WalkInDir(size_t playerId, AxisDirection dir)
|
|
|
|
|
if (!player.isWalking() && player.CanChangeAction()) |
|
|
|
|
player._pdir = pdir; |
|
|
|
|
|
|
|
|
|
#ifndef USE_SDL1 |
|
|
|
|
if (ControlMode == ControlTypes::VirtualGamepad) { |
|
|
|
|
if (VirtualGamepadState.standButton.isHeld) { |
|
|
|
|
if (player._pmode == PM_STAND) |
|
|
|
|
StartStand(player, pdir); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (IsStandingGround()) { |
|
|
|
|
if (player._pmode == PM_STAND) |
|
|
|
|
StartStand(player, pdir); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (PosOkPlayer(player, delta) && IsPathBlocked(player.position.future, pdir)) { |
|
|
|
|
if (player._pmode == PM_STAND) |
|
|
|
|
|