♻️ Replace 'cursmx' and 'cursmy' globals with single 'cursPosition'
This commit is contained in:
parent
05d206720a
commit
01823e1324
14 changed files with 180 additions and 264 deletions
|
|
@ -136,8 +136,7 @@ void FindItemOrObject()
|
|||
continue;
|
||||
rotations = newRotations;
|
||||
pcursitem = i;
|
||||
cursmx = mx + xx;
|
||||
cursmy = my + yy;
|
||||
cursPosition = Point { mx, my } + Displacement { xx, yy };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -160,8 +159,7 @@ void FindItemOrObject()
|
|||
continue;
|
||||
rotations = newRotations;
|
||||
pcursobj = o;
|
||||
cursmx = mx + xx;
|
||||
cursmy = my + yy;
|
||||
cursPosition = Point { mx, my } + Displacement { xx, yy };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -396,8 +394,7 @@ void FindTrigger()
|
|||
const int newRotations = GetRotaryDistance(missile.position.tile);
|
||||
if (pcursmissile != -1 && distance == newDistance && rotations < newRotations)
|
||||
continue;
|
||||
cursmx = missile.position.tile.x;
|
||||
cursmy = missile.position.tile.y;
|
||||
cursPosition = missile.position.tile;
|
||||
pcursmissile = mi;
|
||||
distance = newDistance;
|
||||
rotations = newRotations;
|
||||
|
|
@ -413,8 +410,7 @@ void FindTrigger()
|
|||
const int newDistance = GetDistance({ tx, ty }, 2);
|
||||
if (newDistance == 0)
|
||||
continue;
|
||||
cursmx = tx;
|
||||
cursmy = ty;
|
||||
cursPosition = { tx, ty };
|
||||
pcurstrig = i;
|
||||
}
|
||||
|
||||
|
|
@ -425,14 +421,13 @@ void FindTrigger()
|
|||
const int newDistance = GetDistance(quest.position, 2);
|
||||
if (newDistance == 0)
|
||||
continue;
|
||||
cursmx = quest.position.x;
|
||||
cursmy = quest.position.y;
|
||||
cursPosition = quest.position;
|
||||
pcursquest = quest._qidx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pcursmonst != -1 || pcursplr != -1 || cursmx == -1 || cursmy == -1)
|
||||
if (pcursmonst != -1 || pcursplr != -1 || cursPosition.x == -1 || cursPosition.y == -1)
|
||||
return; // Prefer monster/player info text
|
||||
|
||||
CheckTrigForce();
|
||||
|
|
@ -1308,8 +1303,7 @@ void plrctrls_after_check_curs_move()
|
|||
pcursmissile = -1;
|
||||
pcurstrig = -1;
|
||||
pcursquest = Q_INVALID;
|
||||
cursmx = -1;
|
||||
cursmy = -1;
|
||||
cursPosition = { -1, -1 };
|
||||
if (Players[MyPlayerId]._pInvincible) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1393,8 +1387,7 @@ bool SpellHasActorTarget()
|
|||
return false;
|
||||
|
||||
if (spl == SPL_FIREWALL && pcursmonst != -1) {
|
||||
cursmx = Monsters[pcursmonst].position.tile.x;
|
||||
cursmy = Monsters[pcursmonst].position.tile.y;
|
||||
cursPosition = Monsters[pcursmonst].position.tile;
|
||||
}
|
||||
|
||||
return pcursplr != -1 || pcursmonst != -1;
|
||||
|
|
@ -1412,9 +1405,7 @@ void UpdateSpellTarget()
|
|||
|
||||
int range = myPlayer._pRSpell == SPL_TELEPORT ? 4 : 1;
|
||||
|
||||
auto cursm = myPlayer.position.future + Displacement::fromDirection(myPlayer._pdir) * range;
|
||||
cursmx = cursm.x;
|
||||
cursmy = cursm.y;
|
||||
cursPosition = myPlayer.position.future + Displacement::fromDirection(myPlayer._pdir) * range;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1424,12 +1415,10 @@ bool TryDropItem()
|
|||
{
|
||||
const auto &myPlayer = Players[MyPlayerId];
|
||||
|
||||
cursmx = myPlayer.position.future.x + 1;
|
||||
cursmy = myPlayer.position.future.y;
|
||||
cursPosition = myPlayer.position.future + DIR_SE;
|
||||
if (!DropItemBeforeTrig()) {
|
||||
// Try to drop on the other side
|
||||
cursmx = myPlayer.position.future.x;
|
||||
cursmy = myPlayer.position.future.y + 1;
|
||||
cursPosition = myPlayer.position.future + DIR_SW;
|
||||
DropItemBeforeTrig();
|
||||
}
|
||||
|
||||
|
|
@ -1515,9 +1504,9 @@ void PerformSecondaryAction()
|
|||
NewCursor(CURSOR_HAND);
|
||||
|
||||
if (pcursitem != -1) {
|
||||
NetSendCmdLocParam1(true, CMD_GOTOAGETITEM, { cursmx, cursmy }, pcursitem);
|
||||
NetSendCmdLocParam1(true, CMD_GOTOAGETITEM, cursPosition, pcursitem);
|
||||
} else if (pcursobj != -1) {
|
||||
NetSendCmdLocParam1(true, CMD_OPOBJXY, { cursmx, cursmy }, pcursobj);
|
||||
NetSendCmdLocParam1(true, CMD_OPOBJXY, cursPosition, pcursobj);
|
||||
} else {
|
||||
auto &myPlayer = Players[MyPlayerId];
|
||||
if (pcursmissile != -1) {
|
||||
|
|
|
|||
|
|
@ -118,10 +118,8 @@ int8_t pcursitem;
|
|||
int8_t pcursobj;
|
||||
/** Current highlighted player */
|
||||
int8_t pcursplr;
|
||||
/** Current highlighted tile row */
|
||||
int cursmx;
|
||||
/** Current highlighted tile column */
|
||||
int cursmy;
|
||||
/** Current highlighted tile position */
|
||||
Point cursPosition;
|
||||
/** Previously highlighted monster */
|
||||
int pcurstemp;
|
||||
/** Index of current cursor image */
|
||||
|
|
@ -192,8 +190,7 @@ void CelDrawCursor(const Surface &out, Point position, int cursId)
|
|||
void InitLevelCursor()
|
||||
{
|
||||
NewCursor(CURSOR_HAND);
|
||||
cursmx = ViewX;
|
||||
cursmy = ViewY;
|
||||
cursPosition = { ViewX, ViewY };
|
||||
pcurstemp = -1;
|
||||
pcursmonst = -1;
|
||||
pcursobj = -1;
|
||||
|
|
@ -208,20 +205,19 @@ void CheckTown()
|
|||
int mx = ActiveMissiles[i];
|
||||
auto &missile = Missiles[mx];
|
||||
if (missile._mitype == MIS_TOWN) {
|
||||
if ((cursmx == missile.position.tile.x - 1 && cursmy == missile.position.tile.y)
|
||||
|| (cursmx == missile.position.tile.x && cursmy == missile.position.tile.y - 1)
|
||||
|| (cursmx == missile.position.tile.x - 1 && cursmy == missile.position.tile.y - 1)
|
||||
|| (cursmx == missile.position.tile.x - 2 && cursmy == missile.position.tile.y - 1)
|
||||
|| (cursmx == missile.position.tile.x - 2 && cursmy == missile.position.tile.y - 2)
|
||||
|| (cursmx == missile.position.tile.x - 1 && cursmy == missile.position.tile.y - 2)
|
||||
|| (cursmx == missile.position.tile.x && cursmy == missile.position.tile.y)) {
|
||||
if ((cursPosition == (missile.position.tile + Displacement { -1, 0 })
|
||||
|| (cursPosition == (missile.position.tile + Displacement { 0, -1 })
|
||||
|| (cursPosition == (missile.position.tile + Displacement { -1, -1 }))
|
||||
|| (cursPosition == (missile.position.tile + Displacement { -2, -1 }))
|
||||
|| (cursPosition == (missile.position.tile + Displacement { -2, -2 }))
|
||||
|| (cursPosition == (missile.position.tile + Displacement { -1, -2 }))
|
||||
|| (cursPosition == missile.position.tile)))) {
|
||||
trigflag = true;
|
||||
ClearPanel();
|
||||
strcpy(infostr, _("Town Portal"));
|
||||
strcpy(tempstr, fmt::format(_("from {:s}"), Players[missile._misource]._pName).c_str());
|
||||
AddPanelString(tempstr);
|
||||
cursmx = missile.position.tile.x;
|
||||
cursmy = missile.position.tile.y;
|
||||
cursPosition = missile.position.tile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -233,13 +229,13 @@ void CheckRportal()
|
|||
int mx = ActiveMissiles[i];
|
||||
auto &missile = Missiles[mx];
|
||||
if (missile._mitype == MIS_RPORTAL) {
|
||||
if ((cursmx == missile.position.tile.x - 1 && cursmy == missile.position.tile.y)
|
||||
|| (cursmx == missile.position.tile.x && cursmy == missile.position.tile.y - 1)
|
||||
|| (cursmx == missile.position.tile.x - 1 && cursmy == missile.position.tile.y - 1)
|
||||
|| (cursmx == missile.position.tile.x - 2 && cursmy == missile.position.tile.y - 1)
|
||||
|| (cursmx == missile.position.tile.x - 2 && cursmy == missile.position.tile.y - 2)
|
||||
|| (cursmx == missile.position.tile.x - 1 && cursmy == missile.position.tile.y - 2)
|
||||
|| (cursmx == missile.position.tile.x && cursmy == missile.position.tile.y)) {
|
||||
if ((cursPosition == (missile.position.tile + Displacement { -1, 0 }))
|
||||
|| (cursPosition == (missile.position.tile + Displacement { 0, -1 }))
|
||||
|| (cursPosition == (missile.position.tile + Displacement { -1, -1 }))
|
||||
|| (cursPosition == (missile.position.tile + Displacement { -2, -1 }))
|
||||
|| (cursPosition == (missile.position.tile + Displacement { -2, -2 }))
|
||||
|| (cursPosition == (missile.position.tile + Displacement { -1, -2 }))
|
||||
|| (cursPosition == missile.position.tile)) {
|
||||
trigflag = true;
|
||||
ClearPanel();
|
||||
strcpy(infostr, _("Portal to"));
|
||||
|
|
@ -248,8 +244,7 @@ void CheckRportal()
|
|||
else
|
||||
strcpy(tempstr, _("level 15"));
|
||||
AddPanelString(tempstr);
|
||||
cursmx = missile.position.tile.x;
|
||||
cursmy = missile.position.tile.y;
|
||||
cursPosition = missile.position.tile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -364,8 +359,7 @@ void CheckCursMove()
|
|||
}
|
||||
|
||||
if (pcursmonst == -1 && pcursobj == -1 && pcursitem == -1 && pcursinvitem == -1 && pcursplr == -1) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
CheckTrigForce();
|
||||
CheckTown();
|
||||
CheckRportal();
|
||||
|
|
@ -392,8 +386,7 @@ void CheckCursMove()
|
|||
return;
|
||||
}
|
||||
if (pcurs >= CURSOR_FIRSTITEM || spselflag) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
return;
|
||||
}
|
||||
if (MainPanel.Contains(MousePosition)) {
|
||||
|
|
@ -419,63 +412,57 @@ void CheckCursMove()
|
|||
if (!flipflag && mx + 2 < MAXDUNX && my + 1 < MAXDUNY && dMonster[mx + 2][my + 1] != 0 && (dFlags[mx + 2][my + 1] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 2][my + 1] > 0 ? dMonster[mx + 2][my + 1] - 1 : -(dMonster[mx + 2][my + 1] + 1);
|
||||
if (mi == pcurstemp && Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 4) != 0) {
|
||||
cursmx = mx + 2; /// BUGFIX: 'mx + 2' (fixed)
|
||||
cursmy = my + 1; /// BUGFIX: 'my + 1' (fixed)
|
||||
/// BUGFIX: 'mx + 2' (fixed)
|
||||
/// BUGFIX: 'my + 1' (fixed)
|
||||
cursPosition = Point { mx, my } + Displacement { 2, 1 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (flipflag && mx + 1 < MAXDUNX && my + 2 < MAXDUNY && dMonster[mx + 1][my + 2] != 0 && (dFlags[mx + 1][my + 2] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 1][my + 2] > 0 ? dMonster[mx + 1][my + 2] - 1 : -(dMonster[mx + 1][my + 2] + 1);
|
||||
if (mi == pcurstemp && Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 4) != 0) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my + 2;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 2 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (mx + 2 < MAXDUNX && my + 2 < MAXDUNY && dMonster[mx + 2][my + 2] != 0 && (dFlags[mx + 2][my + 2] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 2][my + 2] > 0 ? dMonster[mx + 2][my + 2] - 1 : -(dMonster[mx + 2][my + 2] + 1);
|
||||
if (mi == pcurstemp && Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 4) != 0) {
|
||||
cursmx = mx + 2;
|
||||
cursmy = my + 2;
|
||||
cursPosition = Point { mx, my } + Displacement { 2, 2 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (mx + 1 < MAXDUNX && !flipflag && dMonster[mx + 1][my] != 0 && (dFlags[mx + 1][my] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 1][my] > 0 ? dMonster[mx + 1][my] - 1 : -(dMonster[mx + 1][my] + 1);
|
||||
if (mi == pcurstemp && Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 2) != 0) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 0 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (my + 1 < MAXDUNY && flipflag && dMonster[mx][my + 1] != 0 && (dFlags[mx][my + 1] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx][my + 1] > 0 ? dMonster[mx][my + 1] - 1 : -(dMonster[mx][my + 1] + 1);
|
||||
if (mi == pcurstemp && Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 2) != 0) {
|
||||
cursmx = mx;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 0, 1 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (dMonster[mx][my] != 0 && (dFlags[mx][my] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx][my] > 0 ? dMonster[mx][my] - 1 : -(dMonster[mx][my] + 1);
|
||||
if (mi == pcurstemp && Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 1) != 0) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (mx + 1 < MAXDUNX && my + 1 < MAXDUNY && dMonster[mx + 1][my + 1] != 0 && (dFlags[mx + 1][my + 1] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 1][my + 1] > 0 ? dMonster[mx + 1][my + 1] - 1 : -(dMonster[mx + 1][my + 1] + 1);
|
||||
if (mi == pcurstemp && Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 2) != 0) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 1 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (pcursmonst != -1 && (Monsters[pcursmonst]._mFlags & MFLAG_HIDDEN) != 0) {
|
||||
pcursmonst = -1;
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
}
|
||||
if (pcursmonst != -1 && (Monsters[pcursmonst]._mFlags & MFLAG_GOLEM) != 0 && (Monsters[pcursmonst]._mFlags & MFLAG_BERSERK) == 0) {
|
||||
pcursmonst = -1;
|
||||
|
|
@ -487,63 +474,55 @@ void CheckCursMove()
|
|||
if (!flipflag && mx + 2 < MAXDUNX && my + 1 < MAXDUNY && dMonster[mx + 2][my + 1] != 0 && (dFlags[mx + 2][my + 1] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 2][my + 1] > 0 ? dMonster[mx + 2][my + 1] - 1 : -(dMonster[mx + 2][my + 1] + 1);
|
||||
if (Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 4) != 0) {
|
||||
cursmx = mx + 2;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 2, 1 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (flipflag && mx + 1 < MAXDUNX && my + 2 < MAXDUNY && dMonster[mx + 1][my + 2] != 0 && (dFlags[mx + 1][my + 2] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 1][my + 2] > 0 ? dMonster[mx + 1][my + 2] - 1 : -(dMonster[mx + 1][my + 2] + 1);
|
||||
if (Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 4) != 0) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my + 2;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 2 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (mx + 2 < MAXDUNX && my + 2 < MAXDUNY && dMonster[mx + 2][my + 2] != 0 && (dFlags[mx + 2][my + 2] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 2][my + 2] > 0 ? dMonster[mx + 2][my + 2] - 1 : -(dMonster[mx + 2][my + 2] + 1);
|
||||
if (Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 4) != 0) {
|
||||
cursmx = mx + 2;
|
||||
cursmy = my + 2;
|
||||
cursPosition = Point { mx, my } + Displacement { 2, 2 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (!flipflag && mx + 1 < MAXDUNX && dMonster[mx + 1][my] != 0 && (dFlags[mx + 1][my] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 1][my] > 0 ? dMonster[mx + 1][my] - 1 : -(dMonster[mx + 1][my] + 1);
|
||||
if (Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 2) != 0) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 0 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (flipflag && my + 1 < MAXDUNY && dMonster[mx][my + 1] != 0 && (dFlags[mx][my + 1] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx][my + 1] > 0 ? dMonster[mx][my + 1] - 1 : -(dMonster[mx][my + 1] + 1);
|
||||
if (Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 2) != 0) {
|
||||
cursmx = mx;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 0, 1 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (dMonster[mx][my] != 0 && (dFlags[mx][my] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx][my] > 0 ? dMonster[mx][my] - 1 : -(dMonster[mx][my] + 1);
|
||||
if (Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 1) != 0) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (mx + 1 < MAXDUNX && my + 1 < MAXDUNY && dMonster[mx + 1][my + 1] != 0 && (dFlags[mx + 1][my + 1] & BFLAG_LIT) != 0) {
|
||||
int mi = dMonster[mx + 1][my + 1] > 0 ? dMonster[mx + 1][my + 1] - 1 : -(dMonster[mx + 1][my + 1] + 1);
|
||||
if (Monsters[mi]._mhitpoints >> 6 > 0 && (Monsters[mi].MData->mSelFlag & 2) != 0) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 1 };
|
||||
pcursmonst = mi;
|
||||
}
|
||||
}
|
||||
if (pcursmonst != -1 && (Monsters[pcursmonst]._mFlags & MFLAG_HIDDEN) != 0) {
|
||||
pcursmonst = -1;
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
}
|
||||
if (pcursmonst != -1 && (Monsters[pcursmonst]._mFlags & MFLAG_GOLEM) != 0 && (Monsters[pcursmonst]._mFlags & MFLAG_BERSERK) == 0) {
|
||||
pcursmonst = -1;
|
||||
|
|
@ -551,23 +530,19 @@ void CheckCursMove()
|
|||
} else {
|
||||
if (!flipflag && mx + 1 < MAXDUNX && dMonster[mx + 1][my] > 0) {
|
||||
pcursmonst = dMonster[mx + 1][my] - 1;
|
||||
cursmx = mx + 1;
|
||||
cursmy = my;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 0 };
|
||||
}
|
||||
if (flipflag && my + 1 < MAXDUNY && dMonster[mx][my + 1] > 0) {
|
||||
pcursmonst = dMonster[mx][my + 1] - 1;
|
||||
cursmx = mx;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 0, 1 };
|
||||
}
|
||||
if (dMonster[mx][my] > 0) {
|
||||
pcursmonst = dMonster[mx][my] - 1;
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
}
|
||||
if (mx + 1 < MAXDUNX && my + 1 < MAXDUNY && dMonster[mx + 1][my + 1] > 0) {
|
||||
pcursmonst = dMonster[mx + 1][my + 1] - 1;
|
||||
cursmx = mx + 1;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 1 };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -575,32 +550,28 @@ void CheckCursMove()
|
|||
if (!flipflag && mx + 1 < MAXDUNX && dPlayer[mx + 1][my] != 0) {
|
||||
int8_t bv = dPlayer[mx + 1][my] > 0 ? dPlayer[mx + 1][my] - 1 : -(dPlayer[mx + 1][my] + 1);
|
||||
if (bv != MyPlayerId && Players[bv]._pHitPoints != 0) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 0 };
|
||||
pcursplr = bv;
|
||||
}
|
||||
}
|
||||
if (flipflag && my + 1 < MAXDUNY && dPlayer[mx][my + 1] != 0) {
|
||||
int8_t bv = dPlayer[mx][my + 1] > 0 ? dPlayer[mx][my + 1] - 1 : -(dPlayer[mx][my + 1] + 1);
|
||||
if (bv != MyPlayerId && Players[bv]._pHitPoints != 0) {
|
||||
cursmx = mx;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 0, 1 };
|
||||
pcursplr = bv;
|
||||
}
|
||||
}
|
||||
if (dPlayer[mx][my] != 0) {
|
||||
int8_t bv = dPlayer[mx][my] > 0 ? dPlayer[mx][my] - 1 : -(dPlayer[mx][my] + 1);
|
||||
if (bv != MyPlayerId) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
pcursplr = bv;
|
||||
}
|
||||
}
|
||||
if ((dFlags[mx][my] & BFLAG_DEAD_PLAYER) != 0) {
|
||||
for (int i = 0; i < MAX_PLRS; i++) {
|
||||
if (Players[i].position.tile.x == mx && Players[i].position.tile.y == my && i != MyPlayerId) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
pcursplr = i;
|
||||
}
|
||||
}
|
||||
|
|
@ -611,8 +582,7 @@ void CheckCursMove()
|
|||
if (mx + xx < MAXDUNX && my + yy < MAXDUNY && (dFlags[mx + xx][my + yy] & BFLAG_DEAD_PLAYER) != 0) {
|
||||
for (int i = 0; i < MAX_PLRS; i++) {
|
||||
if (Players[i].position.tile.x == mx + xx && Players[i].position.tile.y == my + yy && i != MyPlayerId) {
|
||||
cursmx = mx + xx;
|
||||
cursmy = my + yy;
|
||||
cursPosition = Point { mx, my } + Displacement { xx, yy };
|
||||
pcursplr = i;
|
||||
}
|
||||
}
|
||||
|
|
@ -623,8 +593,7 @@ void CheckCursMove()
|
|||
if (mx + 1 < MAXDUNX && my + 1 < MAXDUNY && dPlayer[mx + 1][my + 1] != 0) {
|
||||
int8_t bv = dPlayer[mx + 1][my + 1] > 0 ? dPlayer[mx + 1][my + 1] - 1 : -(dPlayer[mx + 1][my + 1] + 1);
|
||||
if (bv != MyPlayerId && Players[bv]._pHitPoints != 0) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 1 };
|
||||
pcursplr = bv;
|
||||
}
|
||||
}
|
||||
|
|
@ -633,32 +602,28 @@ void CheckCursMove()
|
|||
if (!flipflag && mx + 1 < MAXDUNX && dObject[mx + 1][my] != 0) {
|
||||
int8_t bv = dObject[mx + 1][my] > 0 ? dObject[mx + 1][my] - 1 : -(dObject[mx + 1][my] + 1);
|
||||
if (Objects[bv]._oSelFlag >= 2) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 0 };
|
||||
pcursobj = bv;
|
||||
}
|
||||
}
|
||||
if (flipflag && my + 1 < MAXDUNY && dObject[mx][my + 1] != 0) {
|
||||
int8_t bv = dObject[mx][my + 1] > 0 ? dObject[mx][my + 1] - 1 : -(dObject[mx][my + 1] + 1);
|
||||
if (Objects[bv]._oSelFlag >= 2) {
|
||||
cursmx = mx;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 0, 1 };
|
||||
pcursobj = bv;
|
||||
}
|
||||
}
|
||||
if (dObject[mx][my] != 0) {
|
||||
int8_t bv = dObject[mx][my] > 0 ? dObject[mx][my] - 1 : -(dObject[mx][my] + 1);
|
||||
if (Objects[bv]._oSelFlag == 1 || Objects[bv]._oSelFlag == 3) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
pcursobj = bv;
|
||||
}
|
||||
}
|
||||
if (mx + 1 < MAXDUNX && my + 1 < MAXDUNY && dObject[mx + 1][my + 1] != 0) {
|
||||
int8_t bv = dObject[mx + 1][my + 1] > 0 ? dObject[mx + 1][my + 1] - 1 : -(dObject[mx + 1][my + 1] + 1);
|
||||
if (Objects[bv]._oSelFlag >= 2) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 1 };
|
||||
pcursobj = bv;
|
||||
}
|
||||
}
|
||||
|
|
@ -667,38 +632,33 @@ void CheckCursMove()
|
|||
if (!flipflag && mx + 1 < MAXDUNX && dItem[mx + 1][my] > 0) {
|
||||
int8_t bv = dItem[mx + 1][my] - 1;
|
||||
if (Items[bv]._iSelFlag >= 2) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 0 };
|
||||
pcursitem = bv;
|
||||
}
|
||||
}
|
||||
if (flipflag && my + 1 < MAXDUNY && dItem[mx][my + 1] > 0) {
|
||||
int8_t bv = dItem[mx][my + 1] - 1;
|
||||
if (Items[bv]._iSelFlag >= 2) {
|
||||
cursmx = mx;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 0, 1 };
|
||||
pcursitem = bv;
|
||||
}
|
||||
}
|
||||
if (dItem[mx][my] > 0) {
|
||||
int8_t bv = dItem[mx][my] - 1;
|
||||
if (Items[bv]._iSelFlag == 1 || Items[bv]._iSelFlag == 3) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
pcursitem = bv;
|
||||
}
|
||||
}
|
||||
if (mx + 1 < MAXDUNX && my + 1 < MAXDUNY && dItem[mx + 1][my + 1] > 0) {
|
||||
int8_t bv = dItem[mx + 1][my + 1] - 1;
|
||||
if (Items[bv]._iSelFlag >= 2) {
|
||||
cursmx = mx + 1;
|
||||
cursmy = my + 1;
|
||||
cursPosition = Point { mx, my } + Displacement { 1, 1 };
|
||||
pcursitem = bv;
|
||||
}
|
||||
}
|
||||
if (pcursitem == -1) {
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
CheckTrigForce();
|
||||
CheckTown();
|
||||
CheckRportal();
|
||||
|
|
@ -709,8 +669,7 @@ void CheckCursMove()
|
|||
pcursobj = -1;
|
||||
pcursmonst = -1;
|
||||
pcursitem = -1;
|
||||
cursmx = mx;
|
||||
cursmy = my;
|
||||
cursPosition = { mx, my };
|
||||
}
|
||||
if (pcursmonst != -1 && (Monsters[pcursmonst]._mFlags & MFLAG_GOLEM) != 0 && (Monsters[pcursmonst]._mFlags & MFLAG_BERSERK) == 0) {
|
||||
pcursmonst = -1;
|
||||
|
|
|
|||
|
|
@ -39,8 +39,7 @@ extern int8_t pcursinvitem;
|
|||
extern int8_t pcursitem;
|
||||
extern int8_t pcursobj;
|
||||
extern int8_t pcursplr;
|
||||
extern int cursmx;
|
||||
extern int cursmy;
|
||||
extern Point cursPosition;
|
||||
extern int pcurs;
|
||||
|
||||
void InitCursor();
|
||||
|
|
|
|||
|
|
@ -544,7 +544,7 @@ void GetDebugMonster()
|
|||
{
|
||||
int mi1 = pcursmonst;
|
||||
if (mi1 == -1) {
|
||||
int mi2 = dMonster[cursmx][cursmy];
|
||||
int mi2 = dMonster[cursPosition.x][cursPosition.y];
|
||||
if (mi2 != 0) {
|
||||
mi1 = mi2 - 1;
|
||||
if (mi2 <= 0)
|
||||
|
|
|
|||
|
|
@ -213,27 +213,27 @@ void LeftMouseCmd(bool bShift)
|
|||
|
||||
if (leveltype == DTYPE_TOWN) {
|
||||
if (pcursitem != -1 && pcurs == CURSOR_HAND)
|
||||
NetSendCmdLocParam1(true, invflag ? CMD_GOTOGETITEM : CMD_GOTOAGETITEM, { cursmx, cursmy }, pcursitem);
|
||||
NetSendCmdLocParam1(true, invflag ? CMD_GOTOGETITEM : CMD_GOTOAGETITEM, cursPosition, pcursitem);
|
||||
if (pcursmonst != -1)
|
||||
NetSendCmdLocParam1(true, CMD_TALKXY, { cursmx, cursmy }, pcursmonst);
|
||||
NetSendCmdLocParam1(true, CMD_TALKXY, cursPosition, pcursmonst);
|
||||
if (pcursitem == -1 && pcursmonst == -1 && pcursplr == -1) {
|
||||
LastMouseButtonAction = MouseActionType::Walk;
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_WALKXY, { cursmx, cursmy });
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_WALKXY, cursPosition);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
auto &myPlayer = Players[MyPlayerId];
|
||||
bNear = myPlayer.position.tile.WalkingDistance({ cursmx, cursmy }) < 2;
|
||||
bNear = myPlayer.position.tile.WalkingDistance(cursPosition) < 2;
|
||||
if (pcursitem != -1 && pcurs == CURSOR_HAND && !bShift) {
|
||||
NetSendCmdLocParam1(true, invflag ? CMD_GOTOGETITEM : CMD_GOTOAGETITEM, { cursmx, cursmy }, pcursitem);
|
||||
NetSendCmdLocParam1(true, invflag ? CMD_GOTOGETITEM : CMD_GOTOAGETITEM, cursPosition, pcursitem);
|
||||
} else if (pcursobj != -1 && (!objectIsDisabled(pcursobj)) && (!bShift || (bNear && Objects[pcursobj]._oBreak == 1))) {
|
||||
LastMouseButtonAction = MouseActionType::OperateObject;
|
||||
NetSendCmdLocParam1(true, pcurs == CURSOR_DISARM ? CMD_DISARMXY : CMD_OPOBJXY, { cursmx, cursmy }, pcursobj);
|
||||
NetSendCmdLocParam1(true, pcurs == CURSOR_DISARM ? CMD_DISARMXY : CMD_OPOBJXY, cursPosition, pcursobj);
|
||||
} else if (myPlayer.UsesRangedWeapon()) {
|
||||
if (bShift) {
|
||||
LastMouseButtonAction = MouseActionType::Attack;
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_RATTACKXY, { cursmx, cursmy });
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_RATTACKXY, cursPosition);
|
||||
} else if (pcursmonst != -1) {
|
||||
if (CanTalkToMonst(Monsters[pcursmonst])) {
|
||||
NetSendCmdParam1(true, CMD_ATTACKID, pcursmonst);
|
||||
|
|
@ -252,11 +252,11 @@ void LeftMouseCmd(bool bShift)
|
|||
NetSendCmdParam1(true, CMD_ATTACKID, pcursmonst);
|
||||
} else {
|
||||
LastMouseButtonAction = MouseActionType::Attack;
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_SATTACKXY, { cursmx, cursmy });
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_SATTACKXY, cursPosition);
|
||||
}
|
||||
} else {
|
||||
LastMouseButtonAction = MouseActionType::Attack;
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_SATTACKXY, { cursmx, cursmy });
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_SATTACKXY, cursPosition);
|
||||
}
|
||||
} else if (pcursmonst != -1) {
|
||||
LastMouseButtonAction = MouseActionType::AttackMonsterTarget;
|
||||
|
|
@ -268,7 +268,7 @@ void LeftMouseCmd(bool bShift)
|
|||
}
|
||||
if (!bShift && pcursitem == -1 && pcursobj == -1 && pcursmonst == -1 && pcursplr == -1) {
|
||||
LastMouseButtonAction = MouseActionType::Walk;
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_WALKXY, { cursmx, cursmy });
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_WALKXY, cursPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -326,7 +326,7 @@ void LeftMouseDown(int wParam)
|
|||
CheckSBook();
|
||||
} else if (pcurs >= CURSOR_FIRSTITEM) {
|
||||
if (TryInvPut()) {
|
||||
NetSendCmdPItem(true, CMD_PUTITEM, { cursmx, cursmy });
|
||||
NetSendCmdPItem(true, CMD_PUTITEM, cursPosition);
|
||||
NewCursor(CURSOR_HAND);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -589,7 +589,7 @@ void PressChar(char vkey)
|
|||
auto &myPlayer = Players[MyPlayerId];
|
||||
sprintf(tempstr, "PX = %i PY = %i", myPlayer.position.tile.x, myPlayer.position.tile.y);
|
||||
NetSendCmdString(1 << MyPlayerId, tempstr);
|
||||
sprintf(tempstr, "CX = %i CY = %i DP = %i", cursmx, cursmy, dungeon[cursmx][cursmy]);
|
||||
sprintf(tempstr, "CX = %i CY = %i DP = %i", cursPosition.x, cursPosition.y, dungeon[cursPosition.x][cursPosition.y]);
|
||||
NetSendCmdString(1 << MyPlayerId, tempstr);
|
||||
}
|
||||
return;
|
||||
|
|
@ -1655,7 +1655,7 @@ bool TryIconCurs()
|
|||
else if (pcursplr != -1)
|
||||
NetSendCmdParam3(true, CMD_TSPELLPID, pcursplr, myPlayer._pTSpell, GetSpellLevel(MyPlayerId, myPlayer._pTSpell));
|
||||
else
|
||||
NetSendCmdLocParam2(true, CMD_TSPELLXY, { cursmx, cursmy }, myPlayer._pTSpell, GetSpellLevel(MyPlayerId, myPlayer._pTSpell));
|
||||
NetSendCmdLocParam2(true, CMD_TSPELLXY, cursPosition, myPlayer._pTSpell, GetSpellLevel(MyPlayerId, myPlayer._pTSpell));
|
||||
NewCursor(CURSOR_HAND);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1758,7 +1758,7 @@ bool TryInvPut()
|
|||
|
||||
auto &myPlayer = Players[MyPlayerId];
|
||||
|
||||
Direction dir = GetDirection(myPlayer.position.tile, { cursmx, cursmy });
|
||||
Direction dir = GetDirection(myPlayer.position.tile, cursPosition);
|
||||
if (CanPut(myPlayer.position.tile + dir)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1780,8 +1780,8 @@ int InvPutItem(Player &player, Point position)
|
|||
return -1;
|
||||
|
||||
if (currlevel == 0) {
|
||||
int yp = cursmy;
|
||||
int xp = cursmx;
|
||||
int yp = cursPosition.y;
|
||||
int xp = cursPosition.x;
|
||||
if (player.HoldItem._iCurs == ICURS_RUNE_BOMB && xp >= 79 && xp <= 82 && yp >= 61 && yp <= 64) {
|
||||
Displacement relativePosition = position - player.position.tile;
|
||||
NetSendCmdLocParam2(false, CMD_OPENHIVE, player.position.tile, relativePosition.deltaX, relativePosition.deltaY);
|
||||
|
|
@ -2160,7 +2160,7 @@ bool DropItemBeforeTrig()
|
|||
return false;
|
||||
}
|
||||
|
||||
NetSendCmdPItem(true, CMD_PUTITEM, { cursmx, cursmy });
|
||||
NetSendCmdPItem(true, CMD_PUTITEM, cursPosition);
|
||||
NewCursor(CURSOR_HAND);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4340,10 +4340,10 @@ void UseItem(int p, item_misc_id mid, spell_id spl)
|
|||
player._pSplType = RSPLTYPE_INVALID;
|
||||
player._pSplFrom = 3;
|
||||
player.destAction = ACTION_SPELL;
|
||||
player.destParam1 = cursmx;
|
||||
player.destParam2 = cursmy;
|
||||
player.destParam1 = cursPosition.x;
|
||||
player.destParam2 = cursPosition.y;
|
||||
if (p == MyPlayerId && spl == SPL_NOVA)
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_NOVA, { cursmx, cursmy });
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_NOVA, cursPosition);
|
||||
}
|
||||
break;
|
||||
case IMISC_SCROLLT:
|
||||
|
|
@ -4357,8 +4357,8 @@ void UseItem(int p, item_misc_id mid, spell_id spl)
|
|||
player._pSplType = RSPLTYPE_INVALID;
|
||||
player._pSplFrom = 3;
|
||||
player.destAction = ACTION_SPELL;
|
||||
player.destParam1 = cursmx;
|
||||
player.destParam2 = cursmy;
|
||||
player.destParam1 = cursPosition.x;
|
||||
player.destParam2 = cursPosition.y;
|
||||
}
|
||||
break;
|
||||
case IMISC_BOOK:
|
||||
|
|
|
|||
|
|
@ -2664,7 +2664,7 @@ void AddDisarm(MissileStruct &missile, Point /*dst*/, Direction /*midir*/)
|
|||
NewCursor(CURSOR_DISARM);
|
||||
if (sgbControllerActive) {
|
||||
if (pcursobj != -1)
|
||||
NetSendCmdLocParam1(true, CMD_DISARMXY, { cursmx, cursmy }, pcursobj);
|
||||
NetSendCmdLocParam1(true, CMD_DISARMXY, cursPosition, pcursobj);
|
||||
else
|
||||
NewCursor(CURSOR_HAND);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3529,9 +3529,9 @@ void CheckPlrSpell()
|
|||
|
||||
if (myPlayer._pRSpell == SPL_FIREWALL || myPlayer._pRSpell == SPL_LIGHTWALL) {
|
||||
LastMouseButtonAction = MouseActionType::Spell;
|
||||
Direction sd = GetDirection(myPlayer.position.tile, { cursmx, cursmy });
|
||||
Direction sd = GetDirection(myPlayer.position.tile, cursPosition);
|
||||
sl = GetSpellLevel(MyPlayerId, myPlayer._pRSpell);
|
||||
NetSendCmdLocParam3(true, CMD_SPELLXYD, { cursmx, cursmy }, myPlayer._pRSpell, sd, sl);
|
||||
NetSendCmdLocParam3(true, CMD_SPELLXYD, cursPosition, myPlayer._pRSpell, sd, sl);
|
||||
} else if (pcursmonst != -1) {
|
||||
LastMouseButtonAction = MouseActionType::SpellMonsterTarget;
|
||||
sl = GetSpellLevel(MyPlayerId, myPlayer._pRSpell);
|
||||
|
|
@ -3543,7 +3543,7 @@ void CheckPlrSpell()
|
|||
} else {
|
||||
LastMouseButtonAction = MouseActionType::Spell;
|
||||
sl = GetSpellLevel(MyPlayerId, myPlayer._pRSpell);
|
||||
NetSendCmdLocParam2(true, CMD_SPELLXY, { cursmx, cursmy }, myPlayer._pRSpell, sl);
|
||||
NetSendCmdLocParam2(true, CMD_SPELLXY, cursPosition, myPlayer._pRSpell, sl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -151,8 +151,7 @@ void DrawItemNameLabels(const Surface &out)
|
|||
if (MousePosition.x >= label.pos.x && MousePosition.x < label.pos.x + label.width && MousePosition.y >= label.pos.y - Height + MarginY && MousePosition.y < label.pos.y + MarginY) {
|
||||
if (!gmenu_is_active() && PauseMode == 0 && !MyPlayerIsDead && IsMouseOverGameArea()) {
|
||||
isLabelHighlighted = true;
|
||||
cursmx = item.position.x;
|
||||
cursmy = item.position.y;
|
||||
cursPosition = item.position;
|
||||
pcursitem = label.id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -441,14 +441,11 @@ bool ForceQuests()
|
|||
for (auto &quest : Quests) {
|
||||
if (quest._qidx != Q_BETRAYER && currlevel == quest._qlevel && quest._qslvl != 0) {
|
||||
int ql = quest._qslvl - 1;
|
||||
int qx = quest.position.x;
|
||||
int qy = quest.position.y;
|
||||
|
||||
for (int j = 0; j < 7; j++) {
|
||||
if (qx + questxoff[j] == cursmx && qy + questyoff[j] == cursmy) {
|
||||
if (quest.position + Displacement { questxoff[j], questyoff[j] } == cursPosition) {
|
||||
strcpy(infostr, fmt::format(_(/* TRANSLATORS: Used for Quest Portals. {:s} is a Map Name */ "To {:s}"), _(QuestTriggerNames[ql])).c_str());
|
||||
cursmx = qx;
|
||||
cursmy = qy;
|
||||
cursPosition = quest.position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1210,7 +1210,7 @@ void DrawView(const Surface &out, int startX, int startY)
|
|||
ver *= 2;
|
||||
}
|
||||
Point center = pixelCoords + hor + ver;
|
||||
if (DebugCoords || (DebugCursorCoords && dunCoords == Point { cursmx, cursmy })) {
|
||||
if (DebugCoords || (DebugCursorCoords && dunCoords == cursPosition)) {
|
||||
char coordstr[10];
|
||||
sprintf(coordstr, "%d:%d", dunCoords.x, dunCoords.y);
|
||||
int textWidth = GetLineWidth(coordstr);
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ namespace {
|
|||
|
||||
void RepeatWalk(Player &player)
|
||||
{
|
||||
if (cursmx < 0 || cursmx >= MAXDUNX - 1 || cursmy < 0 || cursmy >= MAXDUNY - 1)
|
||||
if (cursPosition.x < 0 || cursPosition.x >= MAXDUNX - 1 || cursPosition.y < 0 || cursPosition.y >= MAXDUNY - 1)
|
||||
return;
|
||||
|
||||
if (player._pmode != PM_STAND && !(player.IsWalking() && player.AnimInfo.GetFrameToUseForRendering() > 6))
|
||||
return;
|
||||
|
||||
const Point target = player.GetTargetPosition();
|
||||
if (cursmx == target.x && cursmy == target.y)
|
||||
if (cursPosition == target)
|
||||
return;
|
||||
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_WALKXY, { cursmx, cursmy });
|
||||
NetSendCmdLoc(MyPlayerId, true, CMD_WALKXY, cursPosition);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
@ -56,8 +56,8 @@ void RepeatMouseAction()
|
|||
bool rangedAttack = myPlayer.UsesRangedWeapon();
|
||||
switch (LastMouseButtonAction) {
|
||||
case MouseActionType::Attack:
|
||||
if (cursmx >= 0 && cursmx < MAXDUNX && cursmy >= 0 && cursmy < MAXDUNY)
|
||||
NetSendCmdLoc(MyPlayerId, true, rangedAttack ? CMD_RATTACKXY : CMD_SATTACKXY, { cursmx, cursmy });
|
||||
if (cursPosition.x >= 0 && cursPosition.x < MAXDUNX && cursPosition.y >= 0 && cursPosition.y < MAXDUNY)
|
||||
NetSendCmdLoc(MyPlayerId, true, rangedAttack ? CMD_RATTACKXY : CMD_SATTACKXY, cursPosition);
|
||||
break;
|
||||
case MouseActionType::AttackMonsterTarget:
|
||||
if (pcursmonst != -1)
|
||||
|
|
|
|||
169
Source/trigs.cpp
169
Source/trigs.cpp
|
|
@ -337,10 +337,9 @@ bool ForceTownTrig()
|
|||
for (auto tileId : TownDownList) {
|
||||
if (tileId == -1)
|
||||
break;
|
||||
if (dPiece[cursmx][cursmy] == tileId) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == tileId) {
|
||||
strcpy(infostr, _("Down to dungeon"));
|
||||
cursmx = 25;
|
||||
cursmy = 29;
|
||||
cursPosition = { 25, 29 };
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -349,10 +348,9 @@ bool ForceTownTrig()
|
|||
for (auto tileId : TownWarp1List) {
|
||||
if (tileId == -1)
|
||||
break;
|
||||
if (dPiece[cursmx][cursmy] == tileId) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == tileId) {
|
||||
strcpy(infostr, _("Down to catacombs"));
|
||||
cursmx = 49;
|
||||
cursmy = 21;
|
||||
cursPosition = { 49, 21 };
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -360,10 +358,9 @@ bool ForceTownTrig()
|
|||
|
||||
if (IsWarpOpen(DTYPE_CAVES)) {
|
||||
for (int i = 1199; i <= 1220; i++) {
|
||||
if (dPiece[cursmx][cursmy] == i) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == i) {
|
||||
strcpy(infostr, _("Down to caves"));
|
||||
cursmx = 17;
|
||||
cursmy = 69;
|
||||
cursPosition = { 17, 69 };
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -371,10 +368,9 @@ bool ForceTownTrig()
|
|||
|
||||
if (IsWarpOpen(DTYPE_HELL)) {
|
||||
for (int i = 1240; i <= 1255; i++) {
|
||||
if (dPiece[cursmx][cursmy] == i) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == i) {
|
||||
strcpy(infostr, _("Down to hell"));
|
||||
cursmx = 41;
|
||||
cursmy = 80;
|
||||
cursPosition = { 41, 80 };
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -384,10 +380,9 @@ bool ForceTownTrig()
|
|||
for (auto tileId : TownHiveList) {
|
||||
if (tileId == -1)
|
||||
break;
|
||||
if (dPiece[cursmx][cursmy] == tileId) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == tileId) {
|
||||
strcpy(infostr, _("Down to Hive"));
|
||||
cursmx = 80;
|
||||
cursmy = 62;
|
||||
cursPosition = { 80, 62 };
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -397,10 +392,9 @@ bool ForceTownTrig()
|
|||
for (auto tileId : TownCryptList) {
|
||||
if (tileId == -1)
|
||||
break;
|
||||
if (dPiece[cursmx][cursmy] == tileId) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == tileId) {
|
||||
strcpy(infostr, _("Down to Crypt"));
|
||||
cursmx = 36;
|
||||
cursmy = 24;
|
||||
cursPosition = { 36, 24 };
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -413,27 +407,25 @@ bool ForceL1Trig()
|
|||
{
|
||||
if (currlevel < 17) {
|
||||
for (int i = 0; L1UpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L1UpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L1UpList[i]) {
|
||||
if (currlevel > 1)
|
||||
strcpy(infostr, fmt::format(_("Up to level {:d}"), currlevel - 1).c_str());
|
||||
else
|
||||
strcpy(infostr, _("Up to town"));
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABPREVLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; L1DownList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L1DownList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L1DownList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Down to level {:d}"), currlevel + 1).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -441,28 +433,26 @@ bool ForceL1Trig()
|
|||
}
|
||||
} else {
|
||||
for (int i = 0; L5UpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L5UpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L5UpList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Up to Crypt level {:d}"), currlevel - 21).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABPREVLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dPiece[cursmx][cursmy] == 317) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == 317) {
|
||||
strcpy(infostr, _("Cornerstone of the World"));
|
||||
return true;
|
||||
}
|
||||
for (int i = 0; L5DownList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L5DownList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L5DownList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Down to Crypt level {:d}"), currlevel - 19).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -470,15 +460,14 @@ bool ForceL1Trig()
|
|||
}
|
||||
if (currlevel == 21) {
|
||||
for (int i = 0; L5TWarpUpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L5TWarpUpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L5TWarpUpList[i]) {
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABTWARPUP) {
|
||||
int dx = abs(trigs[j].position.x - cursmx);
|
||||
int dy = abs(trigs[j].position.y - cursmy);
|
||||
int dx = abs(trigs[j].position.x - cursPosition.x);
|
||||
int dy = abs(trigs[j].position.y - cursPosition.y);
|
||||
if (dx < 4 && dy < 4) {
|
||||
strcpy(infostr, _("Up to town"));
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -494,15 +483,14 @@ bool ForceL1Trig()
|
|||
bool ForceL2Trig()
|
||||
{
|
||||
for (int i = 0; L2UpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L2UpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L2UpList[i]) {
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABPREVLVL) {
|
||||
int dx = abs(trigs[j].position.x - cursmx);
|
||||
int dy = abs(trigs[j].position.y - cursmy);
|
||||
int dx = abs(trigs[j].position.x - cursPosition.x);
|
||||
int dy = abs(trigs[j].position.y - cursPosition.y);
|
||||
if (dx < 4 && dy < 4) {
|
||||
strcpy(infostr, fmt::format(_("Up to level {:d}"), currlevel - 1).c_str());
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -511,12 +499,11 @@ bool ForceL2Trig()
|
|||
}
|
||||
|
||||
for (int i = 0; L2DownList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L2DownList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L2DownList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Down to level {:d}"), currlevel + 1).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -525,15 +512,14 @@ bool ForceL2Trig()
|
|||
|
||||
if (currlevel == 5) {
|
||||
for (int i = 0; L2TWarpUpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L2TWarpUpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L2TWarpUpList[i]) {
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABTWARPUP) {
|
||||
int dx = abs(trigs[j].position.x - cursmx);
|
||||
int dy = abs(trigs[j].position.y - cursmy);
|
||||
int dx = abs(trigs[j].position.x - cursPosition.x);
|
||||
int dy = abs(trigs[j].position.y - cursPosition.y);
|
||||
if (dx < 4 && dy < 4) {
|
||||
strcpy(infostr, _("Up to town"));
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -549,26 +535,24 @@ bool ForceL3Trig()
|
|||
{
|
||||
if (currlevel < 17) {
|
||||
for (int i = 0; L3UpList[i] != -1; ++i) {
|
||||
if (dPiece[cursmx][cursmy] == L3UpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L3UpList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Up to level {:d}"), currlevel - 1).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABPREVLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; L3DownList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L3DownList[i]
|
||||
|| dPiece[cursmx + 1][cursmy] == L3DownList[i]
|
||||
|| dPiece[cursmx + 2][cursmy] == L3DownList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L3DownList[i]
|
||||
|| dPiece[cursPosition.x + 1][cursPosition.y] == L3DownList[i]
|
||||
|| dPiece[cursPosition.x + 2][cursPosition.y] == L3DownList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Down to level {:d}"), currlevel + 1).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -576,26 +560,24 @@ bool ForceL3Trig()
|
|||
}
|
||||
} else {
|
||||
for (int i = 0; L6UpList[i] != -1; ++i) {
|
||||
if (dPiece[cursmx][cursmy] == L6UpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L6UpList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Up to Nest level {:d}"), currlevel - 17).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABPREVLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; L6DownList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L6DownList[i]
|
||||
|| dPiece[cursmx + 1][cursmy] == L6DownList[i]
|
||||
|| dPiece[cursmx + 2][cursmy] == L6DownList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L6DownList[i]
|
||||
|| dPiece[cursPosition.x + 1][cursPosition.y] == L6DownList[i]
|
||||
|| dPiece[cursPosition.x + 2][cursPosition.y] == L6DownList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Down to level {:d}"), currlevel - 15).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -605,15 +587,14 @@ bool ForceL3Trig()
|
|||
|
||||
if (currlevel == 9) {
|
||||
for (int i = 0; L3TWarpUpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L3TWarpUpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L3TWarpUpList[i]) {
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABTWARPUP) {
|
||||
int dx = abs(trigs[j].position.x - cursmx);
|
||||
int dy = abs(trigs[j].position.y - cursmy);
|
||||
int dx = abs(trigs[j].position.x - cursPosition.x);
|
||||
int dy = abs(trigs[j].position.y - cursPosition.y);
|
||||
if (dx < 4 && dy < 4) {
|
||||
strcpy(infostr, _("Up to town"));
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -623,15 +604,14 @@ bool ForceL3Trig()
|
|||
}
|
||||
if (currlevel == 17) {
|
||||
for (int i = 0; L6TWarpUpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L6TWarpUpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L6TWarpUpList[i]) {
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABTWARPUP) {
|
||||
int dx = abs(trigs[j].position.x - cursmx);
|
||||
int dy = abs(trigs[j].position.y - cursmy);
|
||||
int dx = abs(trigs[j].position.x - cursPosition.x);
|
||||
int dy = abs(trigs[j].position.y - cursPosition.y);
|
||||
if (dx < 4 && dy < 4) {
|
||||
strcpy(infostr, _("Up to town"));
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -646,12 +626,11 @@ bool ForceL3Trig()
|
|||
bool ForceL4Trig()
|
||||
{
|
||||
for (int i = 0; L4UpList[i] != -1; ++i) {
|
||||
if (dPiece[cursmx][cursmy] == L4UpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L4UpList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Up to level {:d}"), currlevel - 1).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABPREVLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -659,12 +638,11 @@ bool ForceL4Trig()
|
|||
}
|
||||
|
||||
for (int i = 0; L4DownList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L4DownList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L4DownList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Down to level {:d}"), currlevel + 1).c_str());
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -673,15 +651,14 @@ bool ForceL4Trig()
|
|||
|
||||
if (currlevel == 13) {
|
||||
for (int i = 0; L4TWarpUpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L4TWarpUpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L4TWarpUpList[i]) {
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABTWARPUP) {
|
||||
int dx = abs(trigs[j].position.x - cursmx);
|
||||
int dy = abs(trigs[j].position.y - cursmy);
|
||||
int dx = abs(trigs[j].position.x - cursPosition.x);
|
||||
int dy = abs(trigs[j].position.y - cursPosition.y);
|
||||
if (dx < 4 && dy < 4) {
|
||||
strcpy(infostr, _("Up to town"));
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -692,12 +669,11 @@ bool ForceL4Trig()
|
|||
|
||||
if (currlevel == 15) {
|
||||
for (int i = 0; L4PentaList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L4PentaList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L4PentaList[i]) {
|
||||
strcpy(infostr, _("Down to Diablo"));
|
||||
for (int j = 0; j < numtrigs; j++) {
|
||||
if (trigs[j]._tmsg == WM_DIABNEXTLVL) {
|
||||
cursmx = trigs[j].position.x;
|
||||
cursmy = trigs[j].position.y;
|
||||
cursPosition = trigs[j].position;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -726,10 +702,9 @@ void Freeupstairs()
|
|||
bool ForceSKingTrig()
|
||||
{
|
||||
for (int i = 0; L1UpList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L1UpList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L1UpList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Back to Level {:d}"), Quests[Q_SKELKING]._qlevel).c_str());
|
||||
cursmx = trigs[0].position.x;
|
||||
cursmy = trigs[0].position.y;
|
||||
cursPosition = trigs[0].position;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -741,10 +716,9 @@ bool ForceSKingTrig()
|
|||
bool ForceSChambTrig()
|
||||
{
|
||||
for (int i = 0; L2DownList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L2DownList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L2DownList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Back to Level {:d}"), Quests[Q_SCHAMB]._qlevel).c_str());
|
||||
cursmx = trigs[0].position.x;
|
||||
cursmy = trigs[0].position.y;
|
||||
cursPosition = trigs[0].position;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -756,10 +730,9 @@ bool ForceSChambTrig()
|
|||
bool ForcePWaterTrig()
|
||||
{
|
||||
for (int i = 0; L3DownList[i] != -1; i++) {
|
||||
if (dPiece[cursmx][cursmy] == L3DownList[i]) {
|
||||
if (dPiece[cursPosition.x][cursPosition.y] == L3DownList[i]) {
|
||||
strcpy(infostr, fmt::format(_("Back to Level {:d}"), Quests[Q_PWATER]._qlevel).c_str());
|
||||
cursmx = trigs[0].position.x;
|
||||
cursmy = trigs[0].position.y;
|
||||
cursPosition = trigs[0].position;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue