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

Function LoadPlayer

Source/loadsave.cpp:269–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void LoadPlayer(int i)
270{
271 PlayerStruct *pPlayer = &plr[i];
272
273 CopyInt(tbuff, &pPlayer->_pmode);
274 CopyBytes(tbuff, MAX_PATH_LENGTH, pPlayer->walkpath);
275 CopyBytes(tbuff, 1, &pPlayer->plractive);
276 tbuff += 2; // Alignment
277 CopyInt(tbuff, &pPlayer->destAction);
278 CopyInt(tbuff, &pPlayer->destParam1);
279 CopyInt(tbuff, &pPlayer->destParam2);
280 CopyInt(tbuff, &pPlayer->destParam3);
281 CopyInt(tbuff, &pPlayer->destParam4);
282 CopyInt(tbuff, &pPlayer->plrlevel);
283 CopyInt(tbuff, &pPlayer->WorldX);
284 CopyInt(tbuff, &pPlayer->WorldY);
285 CopyInt(tbuff, &pPlayer->_px);
286 CopyInt(tbuff, &pPlayer->_py);
287 CopyInt(tbuff, &pPlayer->_ptargx);
288 CopyInt(tbuff, &pPlayer->_ptargy);
289 CopyInt(tbuff, &pPlayer->_pownerx);
290 CopyInt(tbuff, &pPlayer->_pownery);
291 CopyInt(tbuff, &pPlayer->_poldx);
292 CopyInt(tbuff, &pPlayer->_poldy);
293 CopyInt(tbuff, &pPlayer->_pxoff);
294 CopyInt(tbuff, &pPlayer->_pyoff);
295 CopyInt(tbuff, &pPlayer->_pxvel);
296 CopyInt(tbuff, &pPlayer->_pyvel);
297 CopyInt(tbuff, &pPlayer->_pdir);
298 CopyInt(tbuff, &pPlayer->_nextdir);
299 CopyInt(tbuff, &pPlayer->_pgfxnum);
300 tbuff += 4; // Skip pointer _pAnimData
301 CopyInt(tbuff, &pPlayer->_pAnimDelay);
302 CopyInt(tbuff, &pPlayer->_pAnimCnt);
303 CopyInt(tbuff, &pPlayer->_pAnimLen);
304 CopyInt(tbuff, &pPlayer->_pAnimFrame);
305 CopyInt(tbuff, &pPlayer->_pAnimWidth);
306 CopyInt(tbuff, &pPlayer->_pAnimWidth2);
307 CopyInt(tbuff, &pPlayer->_peflag);
308 CopyInt(tbuff, &pPlayer->_plid);
309 CopyInt(tbuff, &pPlayer->_pvid);
310
311 CopyInt(tbuff, &pPlayer->_pSpell);
312 CopyChar(tbuff, &pPlayer->_pSplType);
313 CopyChar(tbuff, &pPlayer->_pSplFrom);
314 tbuff += 2; // Alignment
315 CopyInt(tbuff, &pPlayer->_pTSpell);
316 CopyChar(tbuff, &pPlayer->_pTSplType);
317 tbuff += 3; // Alignment
318 CopyInt(tbuff, &pPlayer->_pRSpell);
319 CopyChar(tbuff, &pPlayer->_pRSplType);
320 tbuff += 3; // Alignment
321 CopyInt(tbuff, &pPlayer->_pSBkSpell);
322 CopyChar(tbuff, &pPlayer->_pSBkSplType);
323 CopyBytes(tbuff, 64, &pPlayer->_pSplLvl);
324 tbuff += 7; // Alignment
325 CopyInt64(tbuff, &pPlayer->_pMemSpells);
326 CopyInt64(tbuff, &pPlayer->_pAblSpells);

Callers 1

LoadGameFunction · 0.85

Calls 8

CopyIntFunction · 0.85
CopyBytesFunction · 0.85
CopyCharFunction · 0.85
CopyInt64Function · 0.85
CopyIntsFunction · 0.85
LoadItemsFunction · 0.85
LoadItemDataFunction · 0.85
CopyShortsFunction · 0.85

Tested by

no test coverage detected