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

Function PM_DoWalk2

Source/player.cpp:2180–2229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2178}
2179
2180BOOL PM_DoWalk2(int pnum)
2181{
2182 int anim_len;
2183
2184 if ((DWORD)pnum >= MAX_PLRS) {
2185 app_fatal("PM_DoWalk2: illegal player %d", pnum);
2186 }
2187
2188 if (plr[pnum]._pAnimFrame == 3
2189 || (plr[pnum]._pWFrames == 8 && plr[pnum]._pAnimFrame == 7)
2190 || (plr[pnum]._pWFrames != 8 && plr[pnum]._pAnimFrame == 4)) {
2191 PlaySfxLoc(PS_WALK1, plr[pnum].WorldX, plr[pnum].WorldY);
2192 }
2193
2194 anim_len = 8;
2195 if (currlevel != 0) {
2196 anim_len = AnimLenFromClass[plr[pnum]._pClass];
2197 }
2198
2199 if (plr[pnum]._pVar8 == anim_len) {
2200 dPlayer[plr[pnum]._pVar1][plr[pnum]._pVar2] = 0;
2201
2202 if (leveltype != DTYPE_TOWN) {
2203 ChangeLightXY(plr[pnum]._plid, plr[pnum].WorldX, plr[pnum].WorldY);
2204 ChangeVisionXY(plr[pnum]._pvid, plr[pnum].WorldX, plr[pnum].WorldY);
2205 }
2206
2207 if (pnum == myplr && ScrollInfo._sdir) {
2208 ViewX = plr[pnum].WorldX - ScrollInfo._sdx;
2209 ViewY = plr[pnum].WorldY - ScrollInfo._sdy;
2210 }
2211
2212 if (plr[pnum].walkpath[0] != WALK_NONE) {
2213 StartWalkStand(pnum);
2214 } else {
2215 StartStand(pnum, plr[pnum]._pVar3);
2216 }
2217
2218 ClearPlrPVars(pnum);
2219
2220 if (leveltype != DTYPE_TOWN) {
2221 ChangeLightOff(plr[pnum]._plid, 0, 0);
2222 }
2223
2224 return TRUE;
2225 }
2226
2227 PM_ChangeOffset(pnum);
2228 return FALSE;
2229}
2230
2231BOOL PM_DoWalk3(int pnum)
2232{

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