Add m_next2u, analogous to m_next2m and next2u

This commit is contained in:
Pasi Kallinen
2024-01-19 21:53:25 +02:00
parent b6bc3ef698
commit 57747535af
15 changed files with 36 additions and 34 deletions

View File

@@ -1454,7 +1454,7 @@ dopay(void)
for (shkp = next_shkp(fmon, FALSE); shkp;
shkp = next_shkp(shkp->nmon, FALSE)) {
sk++;
if (next2u(shkp->mx, shkp->my)) {
if (m_next2u(shkp)) {
/* next to an irate shopkeeper? prioritize that */
if (nxtm && ANGRY(nxtm))
continue;
@@ -1495,7 +1495,7 @@ dopay(void)
shkp = next_shkp(shkp->nmon, FALSE))
if (canspotmon(shkp))
break;
if (shkp != resident && !next2u(shkp->mx, shkp->my)) {
if (shkp != resident && !m_next2u(shkp)) {
pline("%s is not near enough to receive your payment.",
Shknam(shkp));
return ECMD_OK;
@@ -1533,7 +1533,7 @@ dopay(void)
pline("%s is not interested in your payment.", Monnam(mtmp));
return ECMD_OK;
}
if (mtmp != resident && !next2u(mtmp->mx, mtmp->my)) {
if (mtmp != resident && !m_next2u(mtmp)) {
pline("%s is too far to receive your payment.", Shknam(mtmp));
return ECMD_OK;
}
@@ -2088,7 +2088,7 @@ inherits(
takes[0] = '\0';
if (helpless(shkp))
Strcat(takes, "wakes up and ");
if (!next2u(shkp->mx, shkp->my))
if (!m_next2u(shkp))
Strcat(takes, "comes and ");
Strcat(takes, "takes");
@@ -4505,10 +4505,10 @@ shopdig(int fall)
return;
#endif
}
if (!next2u(shkp->mx, shkp->my)) {
if (!m_next2u(shkp)) {
mnexto(shkp, RLOC_MSG);
/* for some reason the shopkeeper can't come next to you */
if (!next2u(shkp->mx, shkp->my)) {
if (!m_next2u(shkp)) {
if (lang == 2)
pline("%s curses you in anger and frustration!",
Shknam(shkp));