Browse Source

fix gharbad and vision

pull/1485/head
qndel 5 years ago committed by Anders Jenbo
parent
commit
40d33f6778
  1. 1
      Source/lighting.cpp
  2. 4
      Source/player.cpp

1
Source/lighting.cpp

@ -643,6 +643,7 @@ void DoUnVision(int nXPos, int nYPos, int nRadius)
int i, j, x1, y1, x2, y2;
nRadius++;
nRadius++; // increasing the radius even further here prevents leaving stray vision tiles behind and doesn't seem to affect monster AI - applying new vision happens in the same tick
y1 = nYPos - nRadius;
y2 = nYPos + nRadius;
x1 = nXPos - nRadius;

4
Source/player.cpp

@ -2198,8 +2198,6 @@ bool PM_DoWalk(int pnum, int variant)
switch (variant) {
case PM_WALK:
dPlayer[plr[pnum]._px][plr[pnum]._py] = 0;
if (leveltype != DTYPE_TOWN && pnum == myplr)
DoUnVision(plr[pnum]._px, plr[pnum]._py, plr[pnum]._pLightRad); // fix for incorrect vision updating
plr[pnum]._px += plr[pnum]._pVar1;
plr[pnum]._py += plr[pnum]._pVar2;
dPlayer[plr[pnum]._px][plr[pnum]._py] = pnum + 1;
@ -2209,8 +2207,6 @@ bool PM_DoWalk(int pnum, int variant)
break;
case PM_WALK3:
dPlayer[plr[pnum]._px][plr[pnum]._py] = 0;
if (leveltype != DTYPE_TOWN && pnum == myplr)
DoUnVision(plr[pnum]._px, plr[pnum]._py, plr[pnum]._pLightRad); // fix for incorrect vision updating
dFlags[plr[pnum]._pVar4][plr[pnum]._pVar5] &= ~BFLAG_PLAYERLR;
plr[pnum]._px = plr[pnum]._pVar1;
plr[pnum]._py = plr[pnum]._pVar2;

Loading…
Cancel
Save