MCPcopy Create free account
hub / github.com/diasurgical/devilution / PosOkPlayer

Function PosOkPlayer

Source/player.cpp:3545–3594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3543}
3544
3545BOOL PosOkPlayer(int pnum, int x, int y)
3546{
3547 BOOL PosOK;
3548 DWORD p;
3549 char bv;
3550
3551 PosOK = FALSE;
3552 if (x >= 0 && x < MAXDUNX && y >= 0 && y < MAXDUNY && !SolidLoc(x, y) && dPiece[x][y]) {
3553
3554 if (dPlayer[x][y]) {
3555 if (dPlayer[x][y] > 0) {
3556 p = dPlayer[x][y] - 1;
3557 } else {
3558 p = -(dPlayer[x][y] + 1);
3559 }
3560 if (p != pnum && p < MAX_PLRS && plr[p]._pHitPoints) {
3561 return FALSE;
3562 }
3563 }
3564
3565 if (dMonster[x][y]) {
3566 if (currlevel == 0) {
3567 return FALSE;
3568 }
3569 if (dMonster[x][y] <= 0) {
3570 return FALSE;
3571 }
3572 if ((monster[dMonster[x][y] - 1]._mhitpoints >> 6) > 0) {
3573 return FALSE;
3574 }
3575 }
3576
3577 if (dObject[x][y]) {
3578 if (dObject[x][y] > 0) {
3579 bv = dObject[x][y] - 1;
3580 } else {
3581 bv = -(dObject[x][y] + 1);
3582 }
3583 if (object[bv]._oSolidFlag) {
3584 return FALSE;
3585 }
3586 }
3587
3588 PosOK = TRUE;
3589 }
3590
3591 if (!PosOK)
3592 return FALSE;
3593 return TRUE;
3594}
3595
3596void MakePlrPath(int pnum, int xx, int yy, BOOL endspace)
3597{

Callers 11

FindMeleeTargetFunction · 0.85
IsPathBlockedFunction · 0.85
WalkInDirFunction · 0.85
M_TryH2HHitFunction · 0.85
MissToMonstFunction · 0.85
PlacePlayerFunction · 0.85
GetVileMissPosFunction · 0.85
AddRndTeleportFunction · 0.85
InitPlayerFunction · 0.85
PlrDirOKFunction · 0.85
SyncInitPlrPosFunction · 0.85

Calls 1

SolidLocFunction · 0.85

Tested by

no test coverage detected