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

Function PM_ChangeOffset

Source/player.cpp:1204–1227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1202}
1203
1204void PM_ChangeOffset(int pnum)
1205{
1206 int px, py;
1207
1208 if ((DWORD)pnum >= MAX_PLRS) {
1209 app_fatal("PM_ChangeOffset: illegal player %d", pnum);
1210 }
1211
1212 plr[pnum]._pVar8++;
1213 px = plr[pnum]._pVar6 / 256;
1214 py = plr[pnum]._pVar7 / 256;
1215
1216 plr[pnum]._pVar6 += plr[pnum]._pxvel;
1217 plr[pnum]._pVar7 += plr[pnum]._pyvel;
1218 plr[pnum]._pxoff = plr[pnum]._pVar6 / 256;
1219 plr[pnum]._pyoff = plr[pnum]._pVar7 / 256;
1220
1221 if (pnum == myplr && ScrollInfo._sdir) {
1222 ScrollInfo._sxoff += px - plr[pnum]._pxoff;
1223 ScrollInfo._syoff += py - plr[pnum]._pyoff;
1224 }
1225
1226 PM_ChangeLightOff(pnum);
1227}
1228
1229void StartWalk(int pnum, int xvel, int yvel, int xadd, int yadd, int EndDir, int sdir)
1230{

Callers 3

PM_DoWalkFunction · 0.85
PM_DoWalk2Function · 0.85
PM_DoWalk3Function · 0.85

Calls 2

app_fatalFunction · 0.85
PM_ChangeLightOffFunction · 0.85

Tested by

no test coverage detected