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

Function PM_DoWalk3

Source/player.cpp:2231–2284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2229}
2230
2231BOOL PM_DoWalk3(int pnum)
2232{
2233 int anim_len;
2234
2235 if ((DWORD)pnum >= MAX_PLRS) {
2236 app_fatal("PM_DoWalk3: illegal player %d", pnum);
2237 }
2238
2239 if (plr[pnum]._pAnimFrame == 3
2240 || (plr[pnum]._pWFrames == 8 && plr[pnum]._pAnimFrame == 7)
2241 || (plr[pnum]._pWFrames != 8 && plr[pnum]._pAnimFrame == 4)) {
2242 PlaySfxLoc(PS_WALK1, plr[pnum].WorldX, plr[pnum].WorldY);
2243 }
2244
2245 anim_len = 8;
2246 if (currlevel != 0) {
2247 anim_len = AnimLenFromClass[plr[pnum]._pClass];
2248 }
2249
2250 if (plr[pnum]._pVar8 == anim_len) {
2251 dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = 0;
2252 dFlags[plr[pnum]._pVar4][plr[pnum]._pVar5] &= ~BFLAG_PLAYERLR;
2253 plr[pnum].WorldX = plr[pnum]._pVar1;
2254 plr[pnum].WorldY = plr[pnum]._pVar2;
2255 dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = pnum + 1;
2256
2257 if (leveltype != DTYPE_TOWN) {
2258 ChangeLightXY(plr[pnum]._plid, plr[pnum].WorldX, plr[pnum].WorldY);
2259 ChangeVisionXY(plr[pnum]._pvid, plr[pnum].WorldX, plr[pnum].WorldY);
2260 }
2261
2262 if (pnum == myplr && ScrollInfo._sdir) {
2263 ViewX = plr[pnum].WorldX - ScrollInfo._sdx;
2264 ViewY = plr[pnum].WorldY - ScrollInfo._sdy;
2265 }
2266
2267 if (plr[pnum].walkpath[0] != WALK_NONE) {
2268 StartWalkStand(pnum);
2269 } else {
2270 StartStand(pnum, plr[pnum]._pVar3);
2271 }
2272
2273 ClearPlrPVars(pnum);
2274
2275 if (leveltype != DTYPE_TOWN) {
2276 ChangeLightOff(plr[pnum]._plid, 0, 0);
2277 }
2278
2279 return TRUE;
2280 }
2281
2282 PM_ChangeOffset(pnum);
2283 return FALSE;
2284}
2285
2286BOOL WeaponDur(int pnum, int durrnd)
2287{

Callers 1

ProcessPlayersFunction · 0.85

Calls 9

app_fatalFunction · 0.85
PlaySfxLocFunction · 0.85
ChangeLightXYFunction · 0.85
ChangeVisionXYFunction · 0.85
StartWalkStandFunction · 0.85
StartStandFunction · 0.85
ClearPlrPVarsFunction · 0.85
ChangeLightOffFunction · 0.85
PM_ChangeOffsetFunction · 0.85

Tested by

no test coverage detected