Skip to content

Commit

Permalink
Fix inventory controls with stick or dpad
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 authored and AJenbo committed Jul 19, 2019
1 parent aa75c92 commit 366b8b5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Source/plrctrls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ int inv_left = INV_LEFT;
int inv_height = INV_HEIGHT;
static DWORD attacktick;
static DWORD invmove;
DWORD ticks;
int slot = SLOTXY_INV_FIRST;
int spbslot = 0;
coords speedspellscoords[50];
Expand Down Expand Up @@ -131,6 +130,7 @@ bool checkMonstersNearby(bool attack)
return false;
}
if (attack) {
DWORD ticks = GetTickCount();
if (ticks - attacktick > 100) { // prevent accidental double attacks
attacktick = ticks;
LeftMouseCmd(false);
Expand Down Expand Up @@ -163,6 +163,7 @@ void attrIncBtnSnap(int key)
if (chrbtnactive && !plr[myplr]._pStatPts)
return;

DWORD ticks = GetTickCount();
if (ticks - invmove < 80) {
return;
}
Expand Down Expand Up @@ -205,6 +206,8 @@ void invMove(int key)
{
if (!invflag)
return;

DWORD ticks = GetTickCount();
if (ticks - invmove < 80) {
return;
}
Expand Down Expand Up @@ -377,6 +380,7 @@ void hotSpellMove(int key)
if (pcurs > 0)
HideCursor();

DWORD ticks = GetTickCount();
if (ticks - invmove < 80) {
return;
}
Expand Down Expand Up @@ -447,7 +451,7 @@ void walkInDir(int dir)
{
if (invflag || spselflag || chrflag || questlog) // don't walk if inventory, speedbook or char info windows are open
return;
ticks = GetTickCount();
DWORD ticks = GetTickCount();
if (ticks - invmove < 370) {
return;
}
Expand All @@ -460,6 +464,7 @@ void walkInDir(int dir)
static DWORD menuopenslow;
void useBeltPotion(bool mana)
{
DWORD ticks = GetTickCount();
int invNum = 0;
if (ticks - menuopenslow < 300) {
return;
Expand Down Expand Up @@ -541,7 +546,7 @@ void keyboardExpansion(int vikey)
static DWORD opentimer;
static DWORD clickinvtimer;
static DWORD statuptimer;
ticks = GetTickCount();
DWORD ticks = GetTickCount();

if (stextflag > 0 || questlog || helpflag || talkflag || qtextflag)
return;
Expand Down

0 comments on commit 366b8b5

Please sign in to comment.