Devilution
Diablo devolved - magic behind the 1996 computer game
loadsave.cpp
Go to the documentation of this file.
1 
6 #include "all.h"
7 
9 
10 BYTE *tbuff;
11 
12 void LoadGame(BOOL firstflag)
13 {
14  int i, j;
15  DWORD dwLen;
16  char szName[MAX_PATH];
17  BYTE *LoadBuff;
18  int _ViewX, _ViewY, _nummonsters, _numitems, _nummissiles, _nobjects;
19 
20  FreeGameMem();
22  pfile_get_game_name(szName);
23  LoadBuff = pfile_read(szName, &dwLen);
24  tbuff = LoadBuff;
25 
26  if (ILoad() != 'RETL')
27  app_fatal("Invalid save file");
28 
29  setlevel = OLoad();
30  setlvlnum = WLoad();
31  currlevel = WLoad();
32  leveltype = WLoad();
33  _ViewX = WLoad();
34  _ViewY = WLoad();
35  invflag = OLoad();
36  chrflag = OLoad();
37  _nummonsters = WLoad();
38  _numitems = WLoad();
39  _nummissiles = WLoad();
40  _nobjects = WLoad();
41 
42  for (i = 0; i < NUMLEVELS; i++) {
43  glSeedTbl[i] = ILoad();
44  gnLevelTypeTbl[i] = WLoad();
45  }
46 
48 
49  for (i = 0; i < MAXQUESTS; i++)
50  LoadQuest(i);
51  for (i = 0; i < MAXPORTAL; i++)
52  LoadPortal(i);
53 
54  LoadGameLevel(firstflag, 4);
57 
58  ViewX = _ViewX;
59  ViewY = _ViewY;
60  nummonsters = _nummonsters;
61  numitems = _numitems;
62  nummissiles = _nummissiles;
63  nobjects = _nobjects;
64 
65  for (i = 0; i < MAXMONSTERS; i++)
66  monstkills[i] = ILoad();
67 
68  if (leveltype != DTYPE_TOWN) {
69  for (i = 0; i < MAXMONSTERS; i++)
70  monstactive[i] = WLoad();
71  for (i = 0; i < nummonsters; i++)
73  for (i = 0; i < MAXMISSILES; i++)
74  missileactive[i] = BLoad();
75  for (i = 0; i < MAXMISSILES; i++)
76  missileavail[i] = BLoad();
77  for (i = 0; i < nummissiles; i++)
79  for (i = 0; i < MAXOBJECTS; i++)
80  objectactive[i] = BLoad();
81  for (i = 0; i < MAXOBJECTS; i++)
82  objectavail[i] = BLoad();
83  for (i = 0; i < nobjects; i++)
85  for (i = 0; i < nobjects; i++)
87 
88  numlights = WLoad();
89 
90  for (i = 0; i < MAXLIGHTS; i++)
91  lightactive[i] = BLoad();
92  for (i = 0; i < numlights; i++)
94 
95  visionid = WLoad();
96  numvision = WLoad();
97 
98  for (i = 0; i < numvision; i++)
99  LoadVision(i);
100  }
101 
102  for (i = 0; i < MAXITEMS; i++)
103  itemactive[i] = BLoad();
104  for (i = 0; i < MAXITEMS; i++)
105  itemavail[i] = BLoad();
106  for (i = 0; i < numitems; i++)
107  LoadItem(itemactive[i]);
108  for (i = 0; i < 128; i++)
109  UniqueItemFlag[i] = OLoad();
110 
111  for (j = 0; j < MAXDUNY; j++) {
112  for (i = 0; i < MAXDUNX; i++)
113  dLight[i][j] = BLoad();
114  }
115  for (j = 0; j < MAXDUNY; j++) {
116  for (i = 0; i < MAXDUNX; i++)
117  dFlags[i][j] = BLoad();
118  }
119  for (j = 0; j < MAXDUNY; j++) {
120  for (i = 0; i < MAXDUNX; i++)
121  dPlayer[i][j] = BLoad();
122  }
123  for (j = 0; j < MAXDUNY; j++) {
124  for (i = 0; i < MAXDUNX; i++)
125  dItem[i][j] = BLoad();
126  }
127 
128  if (leveltype != DTYPE_TOWN) {
129  for (j = 0; j < MAXDUNY; j++) {
130  for (i = 0; i < MAXDUNX; i++)
131  dMonster[i][j] = WLoad();
132  }
133  for (j = 0; j < MAXDUNY; j++) {
134  for (i = 0; i < MAXDUNX; i++)
135  dDead[i][j] = BLoad();
136  }
137  for (j = 0; j < MAXDUNY; j++) {
138  for (i = 0; i < MAXDUNX; i++)
139  dObject[i][j] = BLoad();
140  }
141  for (j = 0; j < MAXDUNY; j++) {
142  for (i = 0; i < MAXDUNX; i++)
143  dLight[i][j] = BLoad();
144  }
145  for (j = 0; j < MAXDUNY; j++) {
146  for (i = 0; i < MAXDUNX; i++)
147  dPreLight[i][j] = BLoad();
148  }
149  for (j = 0; j < DMAXY; j++) {
150  for (i = 0; i < DMAXX; i++)
151  automapview[i][j] = OLoad();
152  }
153  for (j = 0; j < MAXDUNY; j++) {
154  for (i = 0; i < MAXDUNX; i++)
155  dMissile[i][j] = BLoad();
156  }
157  }
158 
159  numpremium = WLoad();
160  premiumlevel = WLoad();
161 
162  for (i = 0; i < SMITH_PREMIUM_ITEMS; i++)
163  LoadPremium(i);
164 
165  automapflag = OLoad();
166  AutoMapScale = WLoad();
167  mem_free_dbg(LoadBuff);
169  ResyncQuests();
170 
171  if (leveltype != DTYPE_TOWN)
173 
177  ResetPal();
179  gbProcessPlayers = TRUE;
180 }
181 
182 char BLoad()
183 {
184  return *tbuff++;
185 }
186 
187 int WLoad()
188 {
189  int rv = *tbuff++ << 24;
190  rv |= *tbuff++ << 16;
191  rv |= *tbuff++ << 8;
192  rv |= *tbuff++;
193 
194  return rv;
195 }
196 
197 int ILoad()
198 {
199  int rv = *tbuff++ << 24;
200  rv |= *tbuff++ << 16;
201  rv |= *tbuff++ << 8;
202  rv |= *tbuff++;
203 
204  return rv;
205 }
206 
207 BOOL OLoad()
208 {
209  if (*tbuff++ == TRUE)
210  return TRUE;
211  else
212  return FALSE;
213 }
214 
215 void CopyBytes(const void *src, const int n, void *dst)
216 {
217  memcpy(dst, src, n);
218  tbuff += n;
219 }
220 
221 void CopyChar(const void *src, void *dst)
222 {
223  *(char*)dst = *(char*)src;
224  tbuff += 1;
225 }
226 
227 void CopyShort(const void *src, void *dst)
228 {
229  unsigned short buf;
230  memcpy(&buf, src, 2);
231  tbuff += 2;
232  buf = SwapLE16(buf);
233  memcpy(dst, &buf, 2);
234 }
235 
236 void CopyShorts(const void *src, const int n, void *dst)
237 {
238  const auto *s = reinterpret_cast<const unsigned short *>(src);
239  auto *d = reinterpret_cast<unsigned short *>(dst);
240  for(int i = 0; i < n; i++) {
241  CopyShort(s, d);
242  ++d; ++s;
243  }
244 }
245 
246 void CopyInt(const void *src, void *dst)
247 {
248  unsigned int buf;
249  memcpy(&buf, src, 4);
250  tbuff += 4;
251  buf = SwapLE32(buf);
252  memcpy(dst, &buf, 4);
253 }
254 
255 void CopyInts(const void *src, const int n, void *dst)
256 {
257  const auto *s = reinterpret_cast<const unsigned int *>(src);
258  auto *d = reinterpret_cast<unsigned int *>(dst);
259  for(int i = 0; i < n; i++) {
260  CopyInt(s, d);
261  ++d; ++s;
262  }
263 }
264 
265 void CopyInt64(const void *src, void *dst)
266 {
267  unsigned long long buf;
268  memcpy(&buf, src, 8);
269  tbuff += 8;
270  buf = SDL_SwapLE64(buf);
271  memcpy(dst, &buf, 8);
272 }
273 
274 void LoadPlayer(int i)
275 {
276  PlayerStruct *pPlayer = &plr[i];
277 
278  CopyInt(tbuff, &pPlayer->_pmode);
280  CopyBytes(tbuff, 1, &pPlayer->plractive);
281  tbuff += 2; // Alignment
282  CopyInt(tbuff, &pPlayer->destAction);
283  CopyInt(tbuff, &pPlayer->destParam1);
284  CopyInt(tbuff, &pPlayer->destParam2);
285  CopyInt(tbuff, &pPlayer->destParam3);
286  CopyInt(tbuff, &pPlayer->destParam4);
287  CopyInt(tbuff, &pPlayer->plrlevel);
288  CopyInt(tbuff, &pPlayer->WorldX);
289  CopyInt(tbuff, &pPlayer->WorldY);
290  CopyInt(tbuff, &pPlayer->_px);
291  CopyInt(tbuff, &pPlayer->_py);
292  CopyInt(tbuff, &pPlayer->_ptargx);
293  CopyInt(tbuff, &pPlayer->_ptargy);
294  CopyInt(tbuff, &pPlayer->_pownerx);
295  CopyInt(tbuff, &pPlayer->_pownery);
296  CopyInt(tbuff, &pPlayer->_poldx);
297  CopyInt(tbuff, &pPlayer->_poldy);
298  CopyInt(tbuff, &pPlayer->_pxoff);
299  CopyInt(tbuff, &pPlayer->_pyoff);
300  CopyInt(tbuff, &pPlayer->_pxvel);
301  CopyInt(tbuff, &pPlayer->_pyvel);
302  CopyInt(tbuff, &pPlayer->_pdir);
303  CopyInt(tbuff, &pPlayer->_nextdir);
304  CopyInt(tbuff, &pPlayer->_pgfxnum);
305  tbuff += 4; // Skip pointer _pAnimData
306  CopyInt(tbuff, &pPlayer->_pAnimDelay);
307  CopyInt(tbuff, &pPlayer->_pAnimCnt);
308  CopyInt(tbuff, &pPlayer->_pAnimLen);
309  CopyInt(tbuff, &pPlayer->_pAnimFrame);
310  CopyInt(tbuff, &pPlayer->_pAnimWidth);
311  CopyInt(tbuff, &pPlayer->_pAnimWidth2);
312  tbuff += 4; // Skip _peflag
313  CopyInt(tbuff, &pPlayer->_plid);
314  CopyInt(tbuff, &pPlayer->_pvid);
315 
316  CopyInt(tbuff, &pPlayer->_pSpell);
317  CopyChar(tbuff, &pPlayer->_pSplType);
318  CopyChar(tbuff, &pPlayer->_pSplFrom);
319  tbuff += 2; // Alignment
320  CopyInt(tbuff, &pPlayer->_pTSpell);
321  CopyChar(tbuff, &pPlayer->_pTSplType);
322  tbuff += 3; // Alignment
323  CopyInt(tbuff, &pPlayer->_pRSpell);
324  CopyChar(tbuff, &pPlayer->_pRSplType);
325  tbuff += 3; // Alignment
326  CopyInt(tbuff, &pPlayer->_pSBkSpell);
327  CopyChar(tbuff, &pPlayer->_pSBkSplType);
328  CopyBytes(tbuff, 64, &pPlayer->_pSplLvl);
329  tbuff += 7; // Alignment
330  CopyInt64(tbuff, &pPlayer->_pMemSpells);
331  CopyInt64(tbuff, &pPlayer->_pAblSpells);
332  CopyInt64(tbuff, &pPlayer->_pScrlSpells);
333  CopyChar(tbuff, &pPlayer->_pSpellFlags);
334  tbuff += 3; // Alignment
335  CopyInts(tbuff, 4, &pPlayer->_pSplHotKey);
336  CopyBytes(tbuff, 4, &pPlayer->_pSplTHotKey);
337 
338  CopyInt(tbuff, &pPlayer->_pwtype);
339  CopyChar(tbuff, &pPlayer->_pBlockFlag);
340  CopyChar(tbuff, &pPlayer->_pInvincible);
341  CopyChar(tbuff, &pPlayer->_pLightRad);
342  CopyChar(tbuff, &pPlayer->_pLvlChanging);
343 
344  CopyBytes(tbuff, PLR_NAME_LEN, &pPlayer->_pName);
345  CopyChar(tbuff, &pPlayer->_pClass);
346  tbuff += 3; // Alignment
347  CopyInt(tbuff, &pPlayer->_pStrength);
348  CopyInt(tbuff, &pPlayer->_pBaseStr);
349  CopyInt(tbuff, &pPlayer->_pMagic);
350  CopyInt(tbuff, &pPlayer->_pBaseMag);
351  CopyInt(tbuff, &pPlayer->_pDexterity);
352  CopyInt(tbuff, &pPlayer->_pBaseDex);
353  CopyInt(tbuff, &pPlayer->_pVitality);
354  CopyInt(tbuff, &pPlayer->_pBaseVit);
355  CopyInt(tbuff, &pPlayer->_pStatPts);
356  CopyInt(tbuff, &pPlayer->_pDamageMod);
357  CopyInt(tbuff, &pPlayer->_pBaseToBlk);
358  CopyInt(tbuff, &pPlayer->_pHPBase);
359  CopyInt(tbuff, &pPlayer->_pMaxHPBase);
360  CopyInt(tbuff, &pPlayer->_pHitPoints);
361  CopyInt(tbuff, &pPlayer->_pMaxHP);
362  CopyInt(tbuff, &pPlayer->_pHPPer);
363  CopyInt(tbuff, &pPlayer->_pManaBase);
364  CopyInt(tbuff, &pPlayer->_pMaxManaBase);
365  CopyInt(tbuff, &pPlayer->_pMana);
366  CopyInt(tbuff, &pPlayer->_pMaxMana);
367  CopyInt(tbuff, &pPlayer->_pManaPer);
368  CopyChar(tbuff, &pPlayer->_pLevel);
369  CopyChar(tbuff, &pPlayer->_pMaxLvl);
370  tbuff += 2; // Alignment
371  CopyInt(tbuff, &pPlayer->_pExperience);
372  CopyInt(tbuff, &pPlayer->_pMaxExp);
373  CopyInt(tbuff, &pPlayer->_pNextExper);
374  CopyChar(tbuff, &pPlayer->_pArmorClass);
375  CopyChar(tbuff, &pPlayer->_pMagResist);
376  CopyChar(tbuff, &pPlayer->_pFireResist);
377  CopyChar(tbuff, &pPlayer->_pLghtResist);
378  CopyInt(tbuff, &pPlayer->_pGold);
379 
380  CopyInt(tbuff, &pPlayer->_pInfraFlag);
381  CopyInt(tbuff, &pPlayer->_pVar1);
382  CopyInt(tbuff, &pPlayer->_pVar2);
383  CopyInt(tbuff, &pPlayer->_pVar3);
384  CopyInt(tbuff, &pPlayer->_pVar4);
385  CopyInt(tbuff, &pPlayer->_pVar5);
386  CopyInt(tbuff, &pPlayer->_pVar6);
387  CopyInt(tbuff, &pPlayer->_pVar7);
388  CopyInt(tbuff, &pPlayer->_pVar8);
389  CopyBytes(tbuff, NUMLEVELS, &pPlayer->_pLvlVisited);
390  CopyBytes(tbuff, NUMLEVELS, &pPlayer->_pSLvlVisited);
391  tbuff += 2; // Alignment
392 
393  CopyInt(tbuff, &pPlayer->_pGFXLoad);
394  tbuff += 4 * 8; // Skip pointers _pNAnim
395  CopyInt(tbuff, &pPlayer->_pNFrames);
396  CopyInt(tbuff, &pPlayer->_pNWidth);
397  tbuff += 4 * 8; // Skip pointers _pWAnim
398  CopyInt(tbuff, &pPlayer->_pWFrames);
399  CopyInt(tbuff, &pPlayer->_pWWidth);
400  tbuff += 4 * 8; // Skip pointers _pAAnim
401  CopyInt(tbuff, &pPlayer->_pAFrames);
402  CopyInt(tbuff, &pPlayer->_pAWidth);
403  CopyInt(tbuff, &pPlayer->_pAFNum);
404  tbuff += 4 * 8; // Skip pointers _pLAnim
405  tbuff += 4 * 8; // Skip pointers _pFAnim
406  tbuff += 4 * 8; // Skip pointers _pTAnim
407  CopyInt(tbuff, &pPlayer->_pSFrames);
408  CopyInt(tbuff, &pPlayer->_pSWidth);
409  CopyInt(tbuff, &pPlayer->_pSFNum);
410  tbuff += 4 * 8; // Skip pointers _pHAnim
411  CopyInt(tbuff, &pPlayer->_pHFrames);
412  CopyInt(tbuff, &pPlayer->_pHWidth);
413  tbuff += 4 * 8; // Skip pointers _pDAnim
414  CopyInt(tbuff, &pPlayer->_pDFrames);
415  CopyInt(tbuff, &pPlayer->_pDWidth);
416  tbuff += 4 * 8; // Skip pointers _pBAnim
417  CopyInt(tbuff, &pPlayer->_pBFrames);
418  CopyInt(tbuff, &pPlayer->_pBWidth);
419 
420  LoadItems(NUM_INVLOC, pPlayer->InvBody);
422  CopyInt(tbuff, &pPlayer->_pNumInv);
424  LoadItems(MAXBELTITEMS, pPlayer->SpdList);
425  LoadItemData(&pPlayer->HoldItem);
426 
427  CopyInt(tbuff, &pPlayer->_pIMinDam);
428  CopyInt(tbuff, &pPlayer->_pIMaxDam);
429  CopyInt(tbuff, &pPlayer->_pIAC);
430  CopyInt(tbuff, &pPlayer->_pIBonusDam);
431  CopyInt(tbuff, &pPlayer->_pIBonusToHit);
432  CopyInt(tbuff, &pPlayer->_pIBonusAC);
433  CopyInt(tbuff, &pPlayer->_pIBonusDamMod);
434  tbuff += 4; // Alignment
435 
436  CopyInt64(tbuff, &pPlayer->_pISpells);
437  CopyInt(tbuff, &pPlayer->_pIFlags);
438  CopyInt(tbuff, &pPlayer->_pIGetHit);
439  CopyChar(tbuff, &pPlayer->_pISplLvlAdd);
440  CopyChar(tbuff, &pPlayer->_pISplCost);
441  tbuff += 2; // Alignment
442  CopyInt(tbuff, &pPlayer->_pISplDur);
443  CopyInt(tbuff, &pPlayer->_pIEnAc);
444  CopyInt(tbuff, &pPlayer->_pIFMinDam);
445  CopyInt(tbuff, &pPlayer->_pIFMaxDam);
446  CopyInt(tbuff, &pPlayer->_pILMinDam);
447  CopyInt(tbuff, &pPlayer->_pILMaxDam);
448  CopyInt(tbuff, &pPlayer->_pOilType);
449  CopyChar(tbuff, &pPlayer->pTownWarps);
450  CopyChar(tbuff, &pPlayer->pDungMsgs);
451  CopyChar(tbuff, &pPlayer->pLvlLoad);
452  CopyChar(tbuff, &pPlayer->pBattleNet);
453  CopyChar(tbuff, &pPlayer->pManaShield);
454  CopyBytes(tbuff, 3, &pPlayer->bReserved);
455  CopyShorts(tbuff, 8, &pPlayer->wReserved);
456 
457  CopyInt(tbuff, &pPlayer->pDiabloKillLevel);
458  CopyInts(tbuff, 7, &pPlayer->dwReserved);
459 
460  // Omit pointer _pNData
461  // Omit pointer _pWData
462  // Omit pointer _pAData
463  // Omit pointer _pLData
464  // Omit pointer _pFData
465  // Omit pointer _pTData
466  // Omit pointer _pHData
467  // Omit pointer _pDData
468  // Omit pointer _pBData
469  // Omit pointer pReserved
470 }
471 
472 void LoadMonster(int i)
473 {
474  MonsterStruct *pMonster = &monster[i];
475 
476  CopyInt(tbuff, &pMonster->_mMTidx);
477  CopyInt(tbuff, &pMonster->_mmode);
478  CopyChar(tbuff, &pMonster->_mgoal);
479  tbuff += 3; // Alignment
480  CopyInt(tbuff, &pMonster->_mgoalvar1);
481  CopyInt(tbuff, &pMonster->_mgoalvar2);
482  CopyInt(tbuff, &pMonster->_mgoalvar3);
483  CopyInt(tbuff, &pMonster->field_18);
484  CopyChar(tbuff, &pMonster->_pathcount);
485  tbuff += 3; // Alignment
486  CopyInt(tbuff, &pMonster->_mx);
487  CopyInt(tbuff, &pMonster->_my);
488  CopyInt(tbuff, &pMonster->_mfutx);
489  CopyInt(tbuff, &pMonster->_mfuty);
490  CopyInt(tbuff, &pMonster->_moldx);
491  CopyInt(tbuff, &pMonster->_moldy);
492  CopyInt(tbuff, &pMonster->_mxoff);
493  CopyInt(tbuff, &pMonster->_myoff);
494  CopyInt(tbuff, &pMonster->_mxvel);
495  CopyInt(tbuff, &pMonster->_myvel);
496  CopyInt(tbuff, &pMonster->_mdir);
497  CopyInt(tbuff, &pMonster->_menemy);
498  CopyChar(tbuff, &pMonster->_menemyx);
499  CopyChar(tbuff, &pMonster->_menemyy);
500  CopyShort(tbuff, &pMonster->falign_52);
501 
502  tbuff += 4; // Skip pointer _mAnimData
503  CopyInt(tbuff, &pMonster->_mAnimDelay);
504  CopyInt(tbuff, &pMonster->_mAnimCnt);
505  CopyInt(tbuff, &pMonster->_mAnimLen);
506  CopyInt(tbuff, &pMonster->_mAnimFrame);
507  tbuff += 4; // Skip _meflag
508  CopyInt(tbuff, &pMonster->_mDelFlag);
509  CopyInt(tbuff, &pMonster->_mVar1);
510  CopyInt(tbuff, &pMonster->_mVar2);
511  CopyInt(tbuff, &pMonster->_mVar3);
512  CopyInt(tbuff, &pMonster->_mVar4);
513  CopyInt(tbuff, &pMonster->_mVar5);
514  CopyInt(tbuff, &pMonster->_mVar6);
515  CopyInt(tbuff, &pMonster->_mVar7);
516  CopyInt(tbuff, &pMonster->_mVar8);
517  CopyInt(tbuff, &pMonster->_mmaxhp);
518  CopyInt(tbuff, &pMonster->_mhitpoints);
519 
520  CopyChar(tbuff, &pMonster->_mAi);
521  CopyChar(tbuff, &pMonster->_mint);
522  CopyShort(tbuff, &pMonster->falign_9A);
523  CopyInt(tbuff, &pMonster->_mFlags);
524  CopyChar(tbuff, &pMonster->_msquelch);
525  tbuff += 3; // Alignment
526  CopyInt(tbuff, &pMonster->falign_A4);
527  CopyInt(tbuff, &pMonster->_lastx);
528  CopyInt(tbuff, &pMonster->_lasty);
529  CopyInt(tbuff, &pMonster->_mRndSeed);
530  CopyInt(tbuff, &pMonster->_mAISeed);
531  CopyInt(tbuff, &pMonster->falign_B8);
532 
533  CopyChar(tbuff, &pMonster->_uniqtype);
534  CopyChar(tbuff, &pMonster->_uniqtrans);
535  CopyChar(tbuff, &pMonster->_udeadval);
536 
537  CopyChar(tbuff, &pMonster->mWhoHit);
538  CopyChar(tbuff, &pMonster->mLevel);
539  tbuff += 1; // Alignment
540  CopyShort(tbuff, &pMonster->mExp);
541 
542  CopyChar(tbuff, &pMonster->mHit);
543  CopyChar(tbuff, &pMonster->mMinDamage);
544  CopyChar(tbuff, &pMonster->mMaxDamage);
545  CopyChar(tbuff, &pMonster->mHit2);
546  CopyChar(tbuff, &pMonster->mMinDamage2);
547  CopyChar(tbuff, &pMonster->mMaxDamage2);
548  CopyChar(tbuff, &pMonster->mArmorClass);
549  CopyChar(tbuff, &pMonster->falign_CB);
550  CopyShort(tbuff, &pMonster->mMagicRes);
551  tbuff += 2; // Alignment
552 
553  CopyInt(tbuff, &pMonster->mtalkmsg);
554  CopyChar(tbuff, &pMonster->leader);
555  CopyChar(tbuff, &pMonster->leaderflag);
556  CopyChar(tbuff, &pMonster->packsize);
557  CopyChar(tbuff, &pMonster->mlid);
558 
559  // Omit pointer mName;
560  // Omit pointer MType;
561  // Omit pointer MData;
562 
563  SyncMonsterAnim(i);
564 }
565 
566 void LoadMissile(int i)
567 {
568  MissileStruct *pMissile = &missile[i];
569 
570  CopyInt(tbuff, &pMissile->_mitype);
571  CopyInt(tbuff, &pMissile->_mix);
572  CopyInt(tbuff, &pMissile->_miy);
573  CopyInt(tbuff, &pMissile->_mixoff);
574  CopyInt(tbuff, &pMissile->_miyoff);
575  CopyInt(tbuff, &pMissile->_mixvel);
576  CopyInt(tbuff, &pMissile->_miyvel);
577  CopyInt(tbuff, &pMissile->_misx);
578  CopyInt(tbuff, &pMissile->_misy);
579  CopyInt(tbuff, &pMissile->_mitxoff);
580  CopyInt(tbuff, &pMissile->_mityoff);
581  CopyInt(tbuff, &pMissile->_mimfnum);
582  CopyInt(tbuff, &pMissile->_mispllvl);
583  CopyInt(tbuff, &pMissile->_miDelFlag);
584  CopyChar(tbuff, &pMissile->_miAnimType);
585  tbuff += 3; // Alignment
586  CopyInt(tbuff, &pMissile->_miAnimFlags);
587  tbuff += 4; // Skip pointer _miAnimData
588  CopyInt(tbuff, &pMissile->_miAnimDelay);
589  CopyInt(tbuff, &pMissile->_miAnimLen);
590  CopyInt(tbuff, &pMissile->_miAnimWidth);
591  CopyInt(tbuff, &pMissile->_miAnimWidth2);
592  CopyInt(tbuff, &pMissile->_miAnimCnt);
593  CopyInt(tbuff, &pMissile->_miAnimAdd);
594  CopyInt(tbuff, &pMissile->_miAnimFrame);
595  CopyInt(tbuff, &pMissile->_miDrawFlag);
596  CopyInt(tbuff, &pMissile->_miLightFlag);
597  CopyInt(tbuff, &pMissile->_miPreFlag);
598  CopyInt(tbuff, &pMissile->_miUniqTrans);
599  CopyInt(tbuff, &pMissile->_mirange);
600  CopyInt(tbuff, &pMissile->_misource);
601  CopyInt(tbuff, &pMissile->_micaster);
602  CopyInt(tbuff, &pMissile->_midam);
603  CopyInt(tbuff, &pMissile->_miHitFlag);
604  CopyInt(tbuff, &pMissile->_midist);
605  CopyInt(tbuff, &pMissile->_mlid);
606  CopyInt(tbuff, &pMissile->_mirnd);
607  CopyInt(tbuff, &pMissile->_miVar1);
608  CopyInt(tbuff, &pMissile->_miVar2);
609  CopyInt(tbuff, &pMissile->_miVar3);
610  CopyInt(tbuff, &pMissile->_miVar4);
611  CopyInt(tbuff, &pMissile->_miVar5);
612  CopyInt(tbuff, &pMissile->_miVar6);
613  CopyInt(tbuff, &pMissile->_miVar7);
614  CopyInt(tbuff, &pMissile->_miVar8);
615 }
616 
617 void LoadObject(int i)
618 {
619  ObjectStruct *pObject = &object[i];
620 
621  CopyInt(tbuff, &pObject->_otype);
622  CopyInt(tbuff, &pObject->_ox);
623  CopyInt(tbuff, &pObject->_oy);
624  CopyInt(tbuff, &pObject->_oLight);
625  CopyInt(tbuff, &pObject->_oAnimFlag);
626  tbuff += 4; // Skip pointer _oAnimData
627  CopyInt(tbuff, &pObject->_oAnimDelay);
628  CopyInt(tbuff, &pObject->_oAnimCnt);
629  CopyInt(tbuff, &pObject->_oAnimLen);
630  CopyInt(tbuff, &pObject->_oAnimFrame);
631  CopyInt(tbuff, &pObject->_oAnimWidth);
632  CopyInt(tbuff, &pObject->_oAnimWidth2);
633  CopyInt(tbuff, &pObject->_oDelFlag);
634  CopyChar(tbuff, &pObject->_oBreak);
635  tbuff += 3; // Alignment
636  CopyInt(tbuff, &pObject->_oSolidFlag);
637  CopyInt(tbuff, &pObject->_oMissFlag);
638 
639  CopyChar(tbuff, &pObject->_oSelFlag);
640  tbuff += 3; // Alignment
641  CopyInt(tbuff, &pObject->_oPreFlag);
642  CopyInt(tbuff, &pObject->_oTrapFlag);
643  CopyInt(tbuff, &pObject->_oDoorFlag);
644  CopyInt(tbuff, &pObject->_olid);
645  CopyInt(tbuff, &pObject->_oRndSeed);
646  CopyInt(tbuff, &pObject->_oVar1);
647  CopyInt(tbuff, &pObject->_oVar2);
648  CopyInt(tbuff, &pObject->_oVar3);
649  CopyInt(tbuff, &pObject->_oVar4);
650  CopyInt(tbuff, &pObject->_oVar5);
651  CopyInt(tbuff, &pObject->_oVar6);
652  CopyInt(tbuff, &pObject->_oVar7);
653  CopyInt(tbuff, &pObject->_oVar8);
654 }
655 
656 void LoadItem(int i)
657 {
658  LoadItemData(&item[i]);
659  GetItemFrm(i);
660 }
661 
663 {
664  CopyInt(tbuff, &pItem->_iSeed);
665  CopyShort(tbuff, &pItem->_iCreateInfo);
666  tbuff += 2; // Alignment
667  CopyInt(tbuff, &pItem->_itype);
668  CopyInt(tbuff, &pItem->_ix);
669  CopyInt(tbuff, &pItem->_iy);
670  CopyInt(tbuff, &pItem->_iAnimFlag);
671  tbuff += 4; // Skip pointer _iAnimData
672  CopyInt(tbuff, &pItem->_iAnimLen);
673  CopyInt(tbuff, &pItem->_iAnimFrame);
674  CopyInt(tbuff, &pItem->_iAnimWidth);
675  CopyInt(tbuff, &pItem->_iAnimWidth2);
676  CopyInt(tbuff, &pItem->_iDelFlag);
677  CopyChar(tbuff, &pItem->_iSelFlag);
678  tbuff += 3; // Alignment
679  CopyInt(tbuff, &pItem->_iPostDraw);
680  CopyInt(tbuff, &pItem->_iIdentified);
681  CopyChar(tbuff, &pItem->_iMagical);
682  CopyBytes(tbuff, 64, &pItem->_iName);
683  CopyBytes(tbuff, 64, &pItem->_iIName);
684  CopyChar(tbuff, &pItem->_iLoc);
685  CopyChar(tbuff, &pItem->_iClass);
686  tbuff += 1; // Alignment
687  CopyInt(tbuff, &pItem->_iCurs);
688  CopyInt(tbuff, &pItem->_ivalue);
689  CopyInt(tbuff, &pItem->_iIvalue);
690  CopyInt(tbuff, &pItem->_iMinDam);
691  CopyInt(tbuff, &pItem->_iMaxDam);
692  CopyInt(tbuff, &pItem->_iAC);
693  CopyInt(tbuff, &pItem->_iFlags);
694  CopyInt(tbuff, &pItem->_iMiscId);
695  CopyInt(tbuff, &pItem->_iSpell);
696  CopyInt(tbuff, &pItem->_iCharges);
697  CopyInt(tbuff, &pItem->_iMaxCharges);
698  CopyInt(tbuff, &pItem->_iDurability);
699  CopyInt(tbuff, &pItem->_iMaxDur);
700  CopyInt(tbuff, &pItem->_iPLDam);
701  CopyInt(tbuff, &pItem->_iPLToHit);
702  CopyInt(tbuff, &pItem->_iPLAC);
703  CopyInt(tbuff, &pItem->_iPLStr);
704  CopyInt(tbuff, &pItem->_iPLMag);
705  CopyInt(tbuff, &pItem->_iPLDex);
706  CopyInt(tbuff, &pItem->_iPLVit);
707  CopyInt(tbuff, &pItem->_iPLFR);
708  CopyInt(tbuff, &pItem->_iPLLR);
709  CopyInt(tbuff, &pItem->_iPLMR);
710  CopyInt(tbuff, &pItem->_iPLMana);
711  CopyInt(tbuff, &pItem->_iPLHP);
712  CopyInt(tbuff, &pItem->_iPLDamMod);
713  CopyInt(tbuff, &pItem->_iPLGetHit);
714  CopyInt(tbuff, &pItem->_iPLLight);
715  CopyChar(tbuff, &pItem->_iSplLvlAdd);
716  CopyChar(tbuff, &pItem->_iRequest);
717  tbuff += 2; // Alignment
718  CopyInt(tbuff, &pItem->_iUid);
719  CopyInt(tbuff, &pItem->_iFMinDam);
720  CopyInt(tbuff, &pItem->_iFMaxDam);
721  CopyInt(tbuff, &pItem->_iLMinDam);
722  CopyInt(tbuff, &pItem->_iLMaxDam);
723  CopyInt(tbuff, &pItem->_iPLEnAc);
724  CopyChar(tbuff, &pItem->_iPrePower);
725  CopyChar(tbuff, &pItem->_iSufPower);
726  tbuff += 2; // Alignment
727  CopyInt(tbuff, &pItem->_iVAdd1);
728  CopyInt(tbuff, &pItem->_iVMult1);
729  CopyInt(tbuff, &pItem->_iVAdd2);
730  CopyInt(tbuff, &pItem->_iVMult2);
731  CopyChar(tbuff, &pItem->_iMinStr);
732  CopyChar(tbuff, &pItem->_iMinMag);
733  CopyChar(tbuff, &pItem->_iMinDex);
734  tbuff += 1; // Alignment
735  CopyInt(tbuff, &pItem->_iStatFlag);
736  CopyInt(tbuff, &pItem->IDidx);
737  CopyInt(tbuff, &pItem->offs016C);
738 }
739 
740 void LoadItems(const int n, ItemStruct *pItem)
741 {
742  for (int i = 0; i < n; i++) {
743  LoadItemData(&pItem[i]);
744  }
745 }
746 
747 void LoadPremium(int i)
748 {
750 }
751 
752 void LoadQuest(int i)
753 {
754  QuestStruct *pQuest = &quests[i];
755 
756  CopyChar(tbuff, &pQuest->_qlevel);
757  CopyChar(tbuff, &pQuest->_qtype);
758  CopyChar(tbuff, &pQuest->_qactive);
759  CopyChar(tbuff, &pQuest->_qlvltype);
760  CopyInt(tbuff, &pQuest->_qtx);
761  CopyInt(tbuff, &pQuest->_qty);
762  CopyChar(tbuff, &pQuest->_qslvl);
763  CopyChar(tbuff, &pQuest->_qidx);
764  CopyChar(tbuff, &pQuest->_qmsg);
765  CopyChar(tbuff, &pQuest->_qvar1);
766  CopyChar(tbuff, &pQuest->_qvar2);
767  tbuff += 3; // Alignment
768  CopyInt(tbuff, &pQuest->_qlog);
769 
770  ReturnLvlX = WLoad();
771  ReturnLvlY = WLoad();
772  ReturnLvl = WLoad();
773  ReturnLvlT = WLoad();
774  DoomQuestState = WLoad();
775 }
776 
777 void LoadLighting(int i)
778 {
779  LightListStruct *pLight = &LightList[i];
780 
781  CopyInt(tbuff, &pLight->_lx);
782  CopyInt(tbuff, &pLight->_ly);
783  CopyInt(tbuff, &pLight->_lradius);
784  CopyInt(tbuff, &pLight->_lid);
785  CopyInt(tbuff, &pLight->_ldel);
786  CopyInt(tbuff, &pLight->_lunflag);
787  CopyInt(tbuff, &pLight->field_18);
788  CopyInt(tbuff, &pLight->_lunx);
789  CopyInt(tbuff, &pLight->_luny);
790  CopyInt(tbuff, &pLight->_lunr);
791  CopyInt(tbuff, &pLight->_xoff);
792  CopyInt(tbuff, &pLight->_yoff);
793  CopyInt(tbuff, &pLight->_lflags);
794 }
795 
796 void LoadVision(int i)
797 {
798  LightListStruct *pVision = &VisionList[i];
799 
800  CopyInt(tbuff, &pVision->_lx);
801  CopyInt(tbuff, &pVision->_ly);
802  CopyInt(tbuff, &pVision->_lradius);
803  CopyInt(tbuff, &pVision->_lid);
804  CopyInt(tbuff, &pVision->_ldel);
805  CopyInt(tbuff, &pVision->_lunflag);
806  CopyInt(tbuff, &pVision->field_18);
807  CopyInt(tbuff, &pVision->_lunx);
808  CopyInt(tbuff, &pVision->_luny);
809  CopyInt(tbuff, &pVision->_lunr);
810  CopyInt(tbuff, &pVision->_xoff);
811  CopyInt(tbuff, &pVision->_yoff);
812  CopyInt(tbuff, &pVision->_lflags);
813 }
814 
815 void LoadPortal(int i)
816 {
817  PortalStruct *pPortal = &portal[i];
818 
819  CopyInt(tbuff, &pPortal->open);
820  CopyInt(tbuff, &pPortal->x);
821  CopyInt(tbuff, &pPortal->y);
822  CopyInt(tbuff, &pPortal->level);
823  CopyInt(tbuff, &pPortal->ltype);
824  CopyInt(tbuff, &pPortal->setlvl);
825 }
826 
827 void SaveGame()
828 {
829  int i, j;
830  char szName[MAX_PATH];
831 
832  DWORD dwLen = codec_get_encoded_len(FILEBUFF);
833  BYTE *SaveBuff = DiabloAllocPtr(dwLen);
834  tbuff = SaveBuff;
835 
836  ISave('RETL');
837  OSave(setlevel);
838  WSave(setlvlnum);
839  WSave(currlevel);
840  WSave(leveltype);
841  WSave(ViewX);
842  WSave(ViewY);
843  OSave(invflag);
844  OSave(chrflag);
846  WSave(numitems);
848  WSave(nobjects);
849 
850  for (i = 0; i < NUMLEVELS; i++) {
851  ISave(glSeedTbl[i]);
852  WSave(gnLevelTypeTbl[i]);
853  }
854 
855  SavePlayer(myplr);
856 
857  for (i = 0; i < MAXQUESTS; i++)
858  SaveQuest(i);
859  for (i = 0; i < MAXPORTAL; i++)
860  SavePortal(i);
861  for (i = 0; i < MAXMONSTERS; i++)
862  ISave(monstkills[i]);
863 
864  if (leveltype != DTYPE_TOWN) {
865  for (i = 0; i < MAXMONSTERS; i++)
866  WSave(monstactive[i]);
867  for (i = 0; i < nummonsters; i++)
869  for (i = 0; i < MAXMISSILES; i++)
870  BSave(missileactive[i]);
871  for (i = 0; i < MAXMISSILES; i++)
872  BSave(missileavail[i]);
873  for (i = 0; i < nummissiles; i++)
875  for (i = 0; i < MAXOBJECTS; i++)
876  BSave(objectactive[i]);
877  for (i = 0; i < MAXOBJECTS; i++)
878  BSave(objectavail[i]);
879  for (i = 0; i < nobjects; i++)
881 
882  WSave(numlights);
883 
884  for (i = 0; i < MAXLIGHTS; i++)
885  BSave(lightactive[i]);
886  for (i = 0; i < numlights; i++)
888 
889  WSave(visionid);
890  WSave(numvision);
891 
892  for (i = 0; i < numvision; i++)
893  SaveVision(i);
894  }
895 
896  for (i = 0; i < MAXITEMS; i++)
897  BSave(itemactive[i]);
898  for (i = 0; i < MAXITEMS; i++)
899  BSave(itemavail[i]);
900  for (i = 0; i < numitems; i++)
901  SaveItem(&item[itemactive[i]]);
902  for (i = 0; i < 128; i++)
903  OSave(UniqueItemFlag[i]);
904 
905  for (j = 0; j < MAXDUNY; j++) {
906  for (i = 0; i < MAXDUNX; i++)
907  BSave(dLight[i][j]);
908  }
909  for (j = 0; j < MAXDUNY; j++) {
910  for (i = 0; i < MAXDUNX; i++)
912  }
913  for (j = 0; j < MAXDUNY; j++) {
914  for (i = 0; i < MAXDUNX; i++)
915  BSave(dPlayer[i][j]);
916  }
917  for (j = 0; j < MAXDUNY; j++) {
918  for (i = 0; i < MAXDUNX; i++)
919  BSave(dItem[i][j]);
920  }
921 
922  if (leveltype != DTYPE_TOWN) {
923  for (j = 0; j < MAXDUNY; j++) {
924  for (i = 0; i < MAXDUNX; i++)
925  WSave(dMonster[i][j]);
926  }
927  for (j = 0; j < MAXDUNY; j++) {
928  for (i = 0; i < MAXDUNX; i++)
929  BSave(dDead[i][j]);
930  }
931  for (j = 0; j < MAXDUNY; j++) {
932  for (i = 0; i < MAXDUNX; i++)
933  BSave(dObject[i][j]);
934  }
935  for (j = 0; j < MAXDUNY; j++) {
936  for (i = 0; i < MAXDUNX; i++)
937  BSave(dLight[i][j]);
938  }
939  for (j = 0; j < MAXDUNY; j++) {
940  for (i = 0; i < MAXDUNX; i++)
941  BSave(dPreLight[i][j]);
942  }
943  for (j = 0; j < DMAXY; j++) {
944  for (i = 0; i < DMAXX; i++)
945  OSave(automapview[i][j]);
946  }
947  for (j = 0; j < MAXDUNY; j++) {
948  for (i = 0; i < MAXDUNX; i++)
949  BSave(dMissile[i][j]);
950  }
951  }
952 
953  WSave(numpremium);
955 
956  for (i = 0; i < SMITH_PREMIUM_ITEMS; i++)
957  SavePremium(i);
958 
961  pfile_get_game_name(szName);
962  dwLen = codec_get_encoded_len(tbuff - SaveBuff);
963  pfile_write_save_file(szName, SaveBuff, tbuff - SaveBuff, dwLen);
964  mem_free_dbg(SaveBuff);
965  gbValidSaveFile = TRUE;
968 }
969 
970 void BSave(char v)
971 {
972  *tbuff++ = v;
973 }
974 
975 void WSave(int v)
976 {
977  *tbuff++ = v >> 24;
978  *tbuff++ = v >> 16;
979  *tbuff++ = v >> 8;
980  *tbuff++ = v;
981 }
982 
983 void ISave(int v)
984 {
985  *tbuff++ = v >> 24;
986  *tbuff++ = v >> 16;
987  *tbuff++ = v >> 8;
988  *tbuff++ = v;
989 }
990 
991 void OSave(BOOL v)
992 {
993  if (v != FALSE)
994  *tbuff++ = TRUE;
995  else
996  *tbuff++ = FALSE;
997 }
998 
999 void SavePlayer(int i)
1000 {
1001  PlayerStruct *pPlayer = &plr[i];
1002 
1003  CopyInt(&pPlayer->_pmode, tbuff);
1004  CopyBytes(&pPlayer->walkpath, MAX_PATH_LENGTH, tbuff);
1005  CopyBytes(&pPlayer->plractive, 1, tbuff);
1006  tbuff += 2; // Alignment
1007  CopyInt(&pPlayer->destAction, tbuff);
1008  CopyInt(&pPlayer->destParam1, tbuff);
1009  CopyInt(&pPlayer->destParam2, tbuff);
1010  CopyInt(&pPlayer->destParam3, tbuff);
1011  CopyInt(&pPlayer->destParam4, tbuff);
1012  CopyInt(&pPlayer->plrlevel, tbuff);
1013  CopyInt(&pPlayer->WorldX, tbuff);
1014  CopyInt(&pPlayer->WorldY, tbuff);
1015  CopyInt(&pPlayer->_px, tbuff);
1016  CopyInt(&pPlayer->_py, tbuff);
1017  CopyInt(&pPlayer->_ptargx, tbuff);
1018  CopyInt(&pPlayer->_ptargy, tbuff);
1019  CopyInt(&pPlayer->_pownerx, tbuff);
1020  CopyInt(&pPlayer->_pownery, tbuff);
1021  CopyInt(&pPlayer->_poldx, tbuff);
1022  CopyInt(&pPlayer->_poldy, tbuff);
1023  CopyInt(&pPlayer->_pxoff, tbuff);
1024  CopyInt(&pPlayer->_pyoff, tbuff);
1025  CopyInt(&pPlayer->_pxvel, tbuff);
1026  CopyInt(&pPlayer->_pyvel, tbuff);
1027  CopyInt(&pPlayer->_pdir, tbuff);
1028  CopyInt(&pPlayer->_nextdir, tbuff);
1029  CopyInt(&pPlayer->_pgfxnum, tbuff);
1030  tbuff += 4; // Skip pointer _pAnimData
1031  CopyInt(&pPlayer->_pAnimDelay, tbuff);
1032  CopyInt(&pPlayer->_pAnimCnt, tbuff);
1033  CopyInt(&pPlayer->_pAnimLen, tbuff);
1034  CopyInt(&pPlayer->_pAnimFrame, tbuff);
1035  CopyInt(&pPlayer->_pAnimWidth, tbuff);
1036  CopyInt(&pPlayer->_pAnimWidth2, tbuff);
1037  tbuff += 4; // Skip _peflag
1038  CopyInt(&pPlayer->_plid, tbuff);
1039  CopyInt(&pPlayer->_pvid, tbuff);
1040 
1041  CopyInt(&pPlayer->_pSpell, tbuff);
1042  CopyChar(&pPlayer->_pSplType, tbuff);
1043  CopyChar(&pPlayer->_pSplFrom, tbuff);
1044  tbuff += 2; // Alignment
1045  CopyInt(&pPlayer->_pTSpell, tbuff);
1046  CopyChar(&pPlayer->_pTSplType, tbuff);
1047  tbuff += 3; // Alignment
1048  CopyInt(&pPlayer->_pRSpell, tbuff);
1049  CopyChar(&pPlayer->_pRSplType, tbuff);
1050  tbuff += 3; // Alignment
1051  CopyInt(&pPlayer->_pSBkSpell, tbuff);
1052  CopyChar(&pPlayer->_pSBkSplType, tbuff);
1053  CopyBytes(&pPlayer->_pSplLvl, 64, tbuff);
1054  tbuff += 7; // Alignment
1055  CopyInt64(&pPlayer->_pMemSpells, tbuff);
1056  CopyInt64(&pPlayer->_pAblSpells, tbuff);
1057  CopyInt64(&pPlayer->_pScrlSpells, tbuff);
1058  CopyChar(&pPlayer->_pSpellFlags, tbuff);
1059  tbuff += 3; // Alignment
1060  CopyInts(&pPlayer->_pSplHotKey, 4, tbuff);
1061  CopyBytes(&pPlayer->_pSplTHotKey, 4, tbuff);
1062 
1063  CopyInt(&pPlayer->_pwtype, tbuff);
1064  CopyChar(&pPlayer->_pBlockFlag, tbuff);
1065  CopyChar(&pPlayer->_pInvincible, tbuff);
1066  CopyChar(&pPlayer->_pLightRad, tbuff);
1067  CopyChar(&pPlayer->_pLvlChanging, tbuff);
1068 
1069  CopyBytes(&pPlayer->_pName, PLR_NAME_LEN, tbuff);
1070  CopyChar(&pPlayer->_pClass, tbuff);
1071  tbuff += 3; // Alignment
1072  CopyInt(&pPlayer->_pStrength, tbuff);
1073  CopyInt(&pPlayer->_pBaseStr, tbuff);
1074  CopyInt(&pPlayer->_pMagic, tbuff);
1075  CopyInt(&pPlayer->_pBaseMag, tbuff);
1076  CopyInt(&pPlayer->_pDexterity, tbuff);
1077  CopyInt(&pPlayer->_pBaseDex, tbuff);
1078  CopyInt(&pPlayer->_pVitality, tbuff);
1079  CopyInt(&pPlayer->_pBaseVit, tbuff);
1080  CopyInt(&pPlayer->_pStatPts, tbuff);
1081  CopyInt(&pPlayer->_pDamageMod, tbuff);
1082  CopyInt(&pPlayer->_pBaseToBlk, tbuff);
1083  CopyInt(&pPlayer->_pHPBase, tbuff);
1084  CopyInt(&pPlayer->_pMaxHPBase, tbuff);
1085  CopyInt(&pPlayer->_pHitPoints, tbuff);
1086  CopyInt(&pPlayer->_pMaxHP, tbuff);
1087  CopyInt(&pPlayer->_pHPPer, tbuff);
1088  CopyInt(&pPlayer->_pManaBase, tbuff);
1089  CopyInt(&pPlayer->_pMaxManaBase, tbuff);
1090  CopyInt(&pPlayer->_pMana, tbuff);
1091  CopyInt(&pPlayer->_pMaxMana, tbuff);
1092  CopyInt(&pPlayer->_pManaPer, tbuff);
1093  CopyChar(&pPlayer->_pLevel, tbuff);
1094  CopyChar(&pPlayer->_pMaxLvl, tbuff);
1095  tbuff += 2; // Alignment
1096  CopyInt(&pPlayer->_pExperience, tbuff);
1097  CopyInt(&pPlayer->_pMaxExp, tbuff);
1098  CopyInt(&pPlayer->_pNextExper, tbuff);
1099  CopyChar(&pPlayer->_pArmorClass, tbuff);
1100  CopyChar(&pPlayer->_pMagResist, tbuff);
1101  CopyChar(&pPlayer->_pFireResist, tbuff);
1102  CopyChar(&pPlayer->_pLghtResist, tbuff);
1103  CopyInt(&pPlayer->_pGold, tbuff);
1104 
1105  CopyInt(&pPlayer->_pInfraFlag, tbuff);
1106  CopyInt(&pPlayer->_pVar1, tbuff);
1107  CopyInt(&pPlayer->_pVar2, tbuff);
1108  CopyInt(&pPlayer->_pVar3, tbuff);
1109  CopyInt(&pPlayer->_pVar4, tbuff);
1110  CopyInt(&pPlayer->_pVar5, tbuff);
1111  CopyInt(&pPlayer->_pVar6, tbuff);
1112  CopyInt(&pPlayer->_pVar7, tbuff);
1113  CopyInt(&pPlayer->_pVar8, tbuff);
1114  CopyBytes(&pPlayer->_pLvlVisited, NUMLEVELS, tbuff);
1115  CopyBytes(&pPlayer->_pSLvlVisited, NUMLEVELS, tbuff); // only 10 used
1116  tbuff += 2; // Alignment
1117 
1118  CopyInt(&pPlayer->_pGFXLoad, tbuff);
1119  tbuff += 4 * 8; // Skip pointers _pNAnim
1120  CopyInt(&pPlayer->_pNFrames, tbuff);
1121  CopyInt(&pPlayer->_pNWidth, tbuff);
1122  tbuff += 4 * 8; // Skip pointers _pWAnim
1123  CopyInt(&pPlayer->_pWFrames, tbuff);
1124  CopyInt(&pPlayer->_pWWidth, tbuff);
1125  tbuff += 4 * 8; // Skip pointers _pAAnim
1126  CopyInt(&pPlayer->_pAFrames, tbuff);
1127  CopyInt(&pPlayer->_pAWidth, tbuff);
1128  CopyInt(&pPlayer->_pAFNum, tbuff);
1129  tbuff += 4 * 8; // Skip pointers _pLAnim
1130  tbuff += 4 * 8; // Skip pointers _pFAnim
1131  tbuff += 4 * 8; // Skip pointers _pTAnim
1132  CopyInt(&pPlayer->_pSFrames, tbuff);
1133  CopyInt(&pPlayer->_pSWidth, tbuff);
1134  CopyInt(&pPlayer->_pSFNum, tbuff);
1135  tbuff += 4 * 8; // Skip pointers _pHAnim
1136  CopyInt(&pPlayer->_pHFrames, tbuff);
1137  CopyInt(&pPlayer->_pHWidth, tbuff);
1138  tbuff += 4 * 8; // Skip pointers _pDAnim
1139  CopyInt(&pPlayer->_pDFrames, tbuff);
1140  CopyInt(&pPlayer->_pDWidth, tbuff);
1141  tbuff += 4 * 8; // Skip pointers _pBAnim
1142  CopyInt(&pPlayer->_pBFrames, tbuff);
1143  CopyInt(&pPlayer->_pBWidth, tbuff);
1144 
1145  SaveItems(pPlayer->InvBody, NUM_INVLOC);
1146  SaveItems(pPlayer->InvList, NUM_INV_GRID_ELEM);
1147  CopyInt(&pPlayer->_pNumInv, tbuff);
1149  SaveItems(pPlayer->SpdList, MAXBELTITEMS);
1150  SaveItem(&pPlayer->HoldItem);
1151 
1152  CopyInt(&pPlayer->_pIMinDam, tbuff);
1153  CopyInt(&pPlayer->_pIMaxDam, tbuff);
1154  CopyInt(&pPlayer->_pIAC, tbuff);
1155  CopyInt(&pPlayer->_pIBonusDam, tbuff);
1156  CopyInt(&pPlayer->_pIBonusToHit, tbuff);
1157  CopyInt(&pPlayer->_pIBonusAC, tbuff);
1158  CopyInt(&pPlayer->_pIBonusDamMod, tbuff);
1159  tbuff += 4; // Alignment
1160 
1161  CopyInt64(&pPlayer->_pISpells, tbuff);
1162  CopyInt(&pPlayer->_pIFlags, tbuff);
1163  CopyInt(&pPlayer->_pIGetHit, tbuff);
1164 
1165  CopyChar(&pPlayer->_pISplLvlAdd, tbuff);
1166  CopyChar(&pPlayer->_pISplCost, tbuff);
1167  tbuff += 2; // Alignment
1168  CopyInt(&pPlayer->_pISplDur, tbuff);
1169  CopyInt(&pPlayer->_pIEnAc, tbuff);
1170  CopyInt(&pPlayer->_pIFMinDam, tbuff);
1171  CopyInt(&pPlayer->_pIFMaxDam, tbuff);
1172  CopyInt(&pPlayer->_pILMinDam, tbuff);
1173  CopyInt(&pPlayer->_pILMaxDam, tbuff);
1174  CopyInt(&pPlayer->_pOilType, tbuff);
1175  CopyChar(&pPlayer->pTownWarps, tbuff);
1176  CopyChar(&pPlayer->pDungMsgs, tbuff);
1177  CopyChar(&pPlayer->pLvlLoad, tbuff);
1178  CopyChar(&pPlayer->pBattleNet, tbuff);
1179  CopyChar(&pPlayer->pManaShield, tbuff);
1180  CopyBytes(&pPlayer->bReserved, 3, tbuff);
1181  CopyShorts(&pPlayer->wReserved, 8, tbuff);
1182 
1183  CopyInt(&pPlayer->pDiabloKillLevel, tbuff);
1184  CopyInts(&pPlayer->dwReserved, 7, tbuff);
1185 
1186  // Omit pointer _pNData
1187  // Omit pointer _pWData
1188  // Omit pointer _pAData
1189  // Omit pointer _pLData
1190  // Omit pointer _pFData
1191  // Omit pointer _pTData
1192  // Omit pointer _pHData
1193  // Omit pointer _pDData
1194  // Omit pointer _pBData
1195  // Omit pointer pReserved
1196 }
1197 
1198 void SaveMonster(int i)
1199 {
1200  MonsterStruct *pMonster = &monster[i];
1201 
1202  CopyInt(&pMonster->_mMTidx, tbuff);
1203  CopyInt(&pMonster->_mmode, tbuff);
1204  CopyChar(&pMonster->_mgoal, tbuff);
1205  tbuff += 3; // Alignment
1206  CopyInt(&pMonster->_mgoalvar1, tbuff);
1207  CopyInt(&pMonster->_mgoalvar2, tbuff);
1208  CopyInt(&pMonster->_mgoalvar3, tbuff);
1209  CopyInt(&pMonster->field_18, tbuff);
1210  CopyChar(&pMonster->_pathcount, tbuff);
1211  tbuff += 3; // Alignment
1212  CopyInt(&pMonster->_mx, tbuff);
1213  CopyInt(&pMonster->_my, tbuff);
1214  CopyInt(&pMonster->_mfutx, tbuff);
1215  CopyInt(&pMonster->_mfuty, tbuff);
1216  CopyInt(&pMonster->_moldx, tbuff);
1217  CopyInt(&pMonster->_moldy, tbuff);
1218  CopyInt(&pMonster->_mxoff, tbuff);
1219  CopyInt(&pMonster->_myoff, tbuff);
1220  CopyInt(&pMonster->_mxvel, tbuff);
1221  CopyInt(&pMonster->_myvel, tbuff);
1222  CopyInt(&pMonster->_mdir, tbuff);
1223  CopyInt(&pMonster->_menemy, tbuff);
1224  CopyChar(&pMonster->_menemyx, tbuff);
1225  CopyChar(&pMonster->_menemyy, tbuff);
1226  CopyShort(&pMonster->falign_52, tbuff);
1227 
1228  tbuff += 4; // Skip pointer _mAnimData
1229  CopyInt(&pMonster->_mAnimDelay, tbuff);
1230  CopyInt(&pMonster->_mAnimCnt, tbuff);
1231  CopyInt(&pMonster->_mAnimLen, tbuff);
1232  CopyInt(&pMonster->_mAnimFrame, tbuff);
1233  tbuff += 4; // Skip _meflag
1234  CopyInt(&pMonster->_mDelFlag, tbuff);
1235  CopyInt(&pMonster->_mVar1, tbuff);
1236  CopyInt(&pMonster->_mVar2, tbuff);
1237  CopyInt(&pMonster->_mVar3, tbuff);
1238  CopyInt(&pMonster->_mVar4, tbuff);
1239  CopyInt(&pMonster->_mVar5, tbuff);
1240  CopyInt(&pMonster->_mVar6, tbuff);
1241  CopyInt(&pMonster->_mVar7, tbuff);
1242  CopyInt(&pMonster->_mVar8, tbuff);
1243  CopyInt(&pMonster->_mmaxhp, tbuff);
1244  CopyInt(&pMonster->_mhitpoints, tbuff);
1245 
1246  CopyChar(&pMonster->_mAi, tbuff);
1247  CopyChar(&pMonster->_mint, tbuff);
1248  CopyShort(&pMonster->falign_9A, tbuff);
1249  CopyInt(&pMonster->_mFlags, tbuff);
1250  CopyChar(&pMonster->_msquelch, tbuff);
1251  tbuff += 3; // Alignment
1252  CopyInt(&pMonster->falign_A4, tbuff);
1253  CopyInt(&pMonster->_lastx, tbuff);
1254  CopyInt(&pMonster->_lasty, tbuff);
1255  CopyInt(&pMonster->_mRndSeed, tbuff);
1256  CopyInt(&pMonster->_mAISeed, tbuff);
1257  CopyInt(&pMonster->falign_B8, tbuff);
1258 
1259  CopyChar(&pMonster->_uniqtype, tbuff);
1260  CopyChar(&pMonster->_uniqtrans, tbuff);
1261  CopyChar(&pMonster->_udeadval, tbuff);
1262 
1263  CopyChar(&pMonster->mWhoHit, tbuff);
1264  CopyChar(&pMonster->mLevel, tbuff);
1265  tbuff += 1; // Alignment
1266  CopyShort(&pMonster->mExp, tbuff);
1267 
1268  CopyChar(&pMonster->mHit, tbuff);
1269  CopyChar(&pMonster->mMinDamage, tbuff);
1270  CopyChar(&pMonster->mMaxDamage, tbuff);
1271  CopyChar(&pMonster->mHit2, tbuff);
1272  CopyChar(&pMonster->mMinDamage2, tbuff);
1273  CopyChar(&pMonster->mMaxDamage2, tbuff);
1274  CopyChar(&pMonster->mArmorClass, tbuff);
1275  CopyChar(&pMonster->falign_CB, tbuff);
1276  CopyShort(&pMonster->mMagicRes, tbuff);
1277  tbuff += 2; // Alignment
1278 
1279  CopyInt(&pMonster->mtalkmsg, tbuff);
1280  CopyChar(&pMonster->leader, tbuff);
1281  CopyChar(&pMonster->leaderflag, tbuff);
1282  CopyChar(&pMonster->packsize, tbuff);
1283  CopyChar(&pMonster->mlid, tbuff);
1284 
1285  // Omit pointer mName;
1286  // Omit pointer MType;
1287  // Omit pointer MData;
1288 }
1289 
1290 void SaveMissile(int i)
1291 {
1292  MissileStruct *pMissile = &missile[i];
1293 
1294  CopyInt(&pMissile->_mitype, tbuff);
1295  CopyInt(&pMissile->_mix, tbuff);
1296  CopyInt(&pMissile->_miy, tbuff);
1297  CopyInt(&pMissile->_mixoff, tbuff);
1298  CopyInt(&pMissile->_miyoff, tbuff);
1299  CopyInt(&pMissile->_mixvel, tbuff);
1300  CopyInt(&pMissile->_miyvel, tbuff);
1301  CopyInt(&pMissile->_misx, tbuff);
1302  CopyInt(&pMissile->_misy, tbuff);
1303  CopyInt(&pMissile->_mitxoff, tbuff);
1304  CopyInt(&pMissile->_mityoff, tbuff);
1305  CopyInt(&pMissile->_mimfnum, tbuff);
1306  CopyInt(&pMissile->_mispllvl, tbuff);
1307  CopyInt(&pMissile->_miDelFlag, tbuff);
1308  CopyChar(&pMissile->_miAnimType, tbuff);
1309  tbuff += 3; // Alignment
1310  CopyInt(&pMissile->_miAnimFlags, tbuff);
1311  tbuff += 4; // Skip pointer _miAnimData
1312  CopyInt(&pMissile->_miAnimDelay, tbuff);
1313  CopyInt(&pMissile->_miAnimLen, tbuff);
1314  CopyInt(&pMissile->_miAnimWidth, tbuff);
1315  CopyInt(&pMissile->_miAnimWidth2, tbuff);
1316  CopyInt(&pMissile->_miAnimCnt, tbuff);
1317  CopyInt(&pMissile->_miAnimAdd, tbuff);
1318  CopyInt(&pMissile->_miAnimFrame, tbuff);
1319  CopyInt(&pMissile->_miDrawFlag, tbuff);
1320  CopyInt(&pMissile->_miLightFlag, tbuff);
1321  CopyInt(&pMissile->_miPreFlag, tbuff);
1322  CopyInt(&pMissile->_miUniqTrans, tbuff);
1323  CopyInt(&pMissile->_mirange, tbuff);
1324  CopyInt(&pMissile->_misource, tbuff);
1325  CopyInt(&pMissile->_micaster, tbuff);
1326  CopyInt(&pMissile->_midam, tbuff);
1327  CopyInt(&pMissile->_miHitFlag, tbuff);
1328  CopyInt(&pMissile->_midist, tbuff);
1329  CopyInt(&pMissile->_mlid, tbuff);
1330  CopyInt(&pMissile->_mirnd, tbuff);
1331  CopyInt(&pMissile->_miVar1, tbuff);
1332  CopyInt(&pMissile->_miVar2, tbuff);
1333  CopyInt(&pMissile->_miVar3, tbuff);
1334  CopyInt(&pMissile->_miVar4, tbuff);
1335  CopyInt(&pMissile->_miVar5, tbuff);
1336  CopyInt(&pMissile->_miVar6, tbuff);
1337  CopyInt(&pMissile->_miVar7, tbuff);
1338  CopyInt(&pMissile->_miVar8, tbuff);
1339 }
1340 
1341 void SaveObject(int i)
1342 {
1343  ObjectStruct *pObject = &object[i];
1344 
1345  CopyInt(&pObject->_otype, tbuff);
1346  CopyInt(&pObject->_ox, tbuff);
1347  CopyInt(&pObject->_oy, tbuff);
1348  CopyInt(&pObject->_oLight, tbuff);
1349  CopyInt(&pObject->_oAnimFlag, tbuff);
1350  tbuff += 4; // Skip pointer _oAnimData
1351  CopyInt(&pObject->_oAnimDelay, tbuff);
1352  CopyInt(&pObject->_oAnimCnt, tbuff);
1353  CopyInt(&pObject->_oAnimLen, tbuff);
1354  CopyInt(&pObject->_oAnimFrame, tbuff);
1355  CopyInt(&pObject->_oAnimWidth, tbuff);
1356  CopyInt(&pObject->_oAnimWidth2, tbuff);
1357  CopyInt(&pObject->_oDelFlag, tbuff);
1358  CopyChar(&pObject->_oBreak, tbuff);
1359  tbuff += 3; // Alignment
1360  CopyInt(&pObject->_oSolidFlag, tbuff);
1361  CopyInt(&pObject->_oMissFlag, tbuff);
1362 
1363  CopyChar(&pObject->_oSelFlag, tbuff);
1364  tbuff += 3; // Alignment
1365  CopyInt(&pObject->_oPreFlag, tbuff);
1366  CopyInt(&pObject->_oTrapFlag, tbuff);
1367  CopyInt(&pObject->_oDoorFlag, tbuff);
1368  CopyInt(&pObject->_olid, tbuff);
1369  CopyInt(&pObject->_oRndSeed, tbuff);
1370  CopyInt(&pObject->_oVar1, tbuff);
1371  CopyInt(&pObject->_oVar2, tbuff);
1372  CopyInt(&pObject->_oVar3, tbuff);
1373  CopyInt(&pObject->_oVar4, tbuff);
1374  CopyInt(&pObject->_oVar5, tbuff);
1375  CopyInt(&pObject->_oVar6, tbuff);
1376  CopyInt(&pObject->_oVar7, tbuff);
1377  CopyInt(&pObject->_oVar8, tbuff);
1378 }
1379 
1380 void SaveItem(ItemStruct *pItem)
1381 {
1382  CopyInt(&pItem->_iSeed, tbuff);
1383  CopyShort(&pItem->_iCreateInfo, tbuff);
1384  tbuff += 2; // Alignment
1385  CopyInt(&pItem->_itype, tbuff);
1386  CopyInt(&pItem->_ix, tbuff);
1387  CopyInt(&pItem->_iy, tbuff);
1388  CopyInt(&pItem->_iAnimFlag, tbuff);
1389  tbuff += 4; // Skip pointer _iAnimData
1390  CopyInt(&pItem->_iAnimLen, tbuff);
1391  CopyInt(&pItem->_iAnimFrame, tbuff);
1392  CopyInt(&pItem->_iAnimWidth, tbuff);
1393  CopyInt(&pItem->_iAnimWidth2, tbuff);
1394  CopyInt(&pItem->_iDelFlag, tbuff);
1395  CopyChar(&pItem->_iSelFlag, tbuff);
1396  tbuff += 3; // Alignment
1397  CopyInt(&pItem->_iPostDraw, tbuff);
1398  CopyInt(&pItem->_iIdentified, tbuff);
1399  CopyChar(&pItem->_iMagical, tbuff);
1400  CopyBytes(&pItem->_iName, 64, tbuff);
1401  CopyBytes(&pItem->_iIName, 64, tbuff);
1402  CopyChar(&pItem->_iLoc, tbuff);
1403  CopyChar(&pItem->_iClass, tbuff);
1404  tbuff += 1; // Alignment
1405  CopyInt(&pItem->_iCurs, tbuff);
1406  CopyInt(&pItem->_ivalue, tbuff);
1407  CopyInt(&pItem->_iIvalue, tbuff);
1408  CopyInt(&pItem->_iMinDam, tbuff);
1409  CopyInt(&pItem->_iMaxDam, tbuff);
1410  CopyInt(&pItem->_iAC, tbuff);
1411  CopyInt(&pItem->_iFlags, tbuff);
1412  CopyInt(&pItem->_iMiscId, tbuff);
1413  CopyInt(&pItem->_iSpell, tbuff);
1414  CopyInt(&pItem->_iCharges, tbuff);
1415  CopyInt(&pItem->_iMaxCharges, tbuff);
1416  CopyInt(&pItem->_iDurability, tbuff);
1417  CopyInt(&pItem->_iMaxDur, tbuff);
1418  CopyInt(&pItem->_iPLDam, tbuff);
1419  CopyInt(&pItem->_iPLToHit, tbuff);
1420  CopyInt(&pItem->_iPLAC, tbuff);
1421  CopyInt(&pItem->_iPLStr, tbuff);
1422  CopyInt(&pItem->_iPLMag, tbuff);
1423  CopyInt(&pItem->_iPLDex, tbuff);
1424  CopyInt(&pItem->_iPLVit, tbuff);
1425  CopyInt(&pItem->_iPLFR, tbuff);
1426  CopyInt(&pItem->_iPLLR, tbuff);
1427  CopyInt(&pItem->_iPLMR, tbuff);
1428  CopyInt(&pItem->_iPLMana, tbuff);
1429  CopyInt(&pItem->_iPLHP, tbuff);
1430  CopyInt(&pItem->_iPLDamMod, tbuff);
1431  CopyInt(&pItem->_iPLGetHit, tbuff);
1432  CopyInt(&pItem->_iPLLight, tbuff);
1433  CopyChar(&pItem->_iSplLvlAdd, tbuff);
1434  CopyChar(&pItem->_iRequest, tbuff);
1435  tbuff += 2; // Alignment
1436  CopyInt(&pItem->_iUid, tbuff);
1437  CopyInt(&pItem->_iFMinDam, tbuff);
1438  CopyInt(&pItem->_iFMaxDam, tbuff);
1439  CopyInt(&pItem->_iLMinDam, tbuff);
1440  CopyInt(&pItem->_iLMaxDam, tbuff);
1441  CopyInt(&pItem->_iPLEnAc, tbuff);
1442  CopyChar(&pItem->_iPrePower, tbuff);
1443  CopyChar(&pItem->_iSufPower, tbuff);
1444  tbuff += 2; // Alignment
1445  CopyInt(&pItem->_iVAdd1, tbuff);
1446  CopyInt(&pItem->_iVMult1, tbuff);
1447  CopyInt(&pItem->_iVAdd2, tbuff);
1448  CopyInt(&pItem->_iVMult2, tbuff);
1449  CopyChar(&pItem->_iMinStr, tbuff);
1450  CopyChar(&pItem->_iMinMag, tbuff);
1451  CopyChar(&pItem->_iMinDex, tbuff);
1452  tbuff += 1; // Alignment
1453  CopyInt(&pItem->_iStatFlag, tbuff);
1454  CopyInt(&pItem->IDidx, tbuff);
1455  CopyInt(&pItem->offs016C, tbuff);
1456 }
1457 
1458 void SaveItems(ItemStruct *pItem, const int n)
1459 {
1460  for (int i = 0; i < n; i++) {
1461  SaveItem(&pItem[i]);
1462  }
1463 }
1464 
1465 void SavePremium(int i)
1466 {
1467  SaveItem(&premiumitem[i]);
1468 }
1469 
1470 void SaveQuest(int i)
1471 {
1472  QuestStruct *pQuest = &quests[i];
1473 
1474  CopyChar(&pQuest->_qlevel, tbuff);
1475  CopyChar(&pQuest->_qtype, tbuff);
1476  CopyChar(&pQuest->_qactive, tbuff);
1477  CopyChar(&pQuest->_qlvltype, tbuff);
1478  CopyInt(&pQuest->_qtx, tbuff);
1479  CopyInt(&pQuest->_qty, tbuff);
1480  CopyChar(&pQuest->_qslvl, tbuff);
1481  CopyChar(&pQuest->_qidx, tbuff);
1482  CopyChar(&pQuest->_qmsg, tbuff);
1483  CopyChar(&pQuest->_qvar1, tbuff);
1484  CopyChar(&pQuest->_qvar2, tbuff);
1485  tbuff += 3; // Alignment
1486  CopyInt(&pQuest->_qlog, tbuff);
1487 
1488  WSave(ReturnLvlX);
1489  WSave(ReturnLvlY);
1490  WSave(ReturnLvl);
1491  WSave(ReturnLvlT);
1493 }
1494 
1495 void SaveLighting(int i)
1496 {
1497  LightListStruct *pLight = &LightList[i];
1498 
1499  CopyInt(&pLight->_lx, tbuff);
1500  CopyInt(&pLight->_ly, tbuff);
1501  CopyInt(&pLight->_lradius, tbuff);
1502  CopyInt(&pLight->_lid, tbuff);
1503  CopyInt(&pLight->_ldel, tbuff);
1504  CopyInt(&pLight->_lunflag, tbuff);
1505  CopyInt(&pLight->field_18, tbuff);
1506  CopyInt(&pLight->_lunx, tbuff);
1507  CopyInt(&pLight->_luny, tbuff);
1508  CopyInt(&pLight->_lunr, tbuff);
1509  CopyInt(&pLight->_xoff, tbuff);
1510  CopyInt(&pLight->_yoff, tbuff);
1511  CopyInt(&pLight->_lflags, tbuff);
1512 }
1513 
1514 void SaveVision(int i)
1515 {
1516  LightListStruct *pVision = &VisionList[i];
1517 
1518  CopyInt(&pVision->_lx, tbuff);
1519  CopyInt(&pVision->_ly, tbuff);
1520  CopyInt(&pVision->_lradius, tbuff);
1521  CopyInt(&pVision->_lid, tbuff);
1522  CopyInt(&pVision->_ldel, tbuff);
1523  CopyInt(&pVision->_lunflag, tbuff);
1524  CopyInt(&pVision->field_18, tbuff);
1525  CopyInt(&pVision->_lunx, tbuff);
1526  CopyInt(&pVision->_luny, tbuff);
1527  CopyInt(&pVision->_lunr, tbuff);
1528  CopyInt(&pVision->_xoff, tbuff);
1529  CopyInt(&pVision->_yoff, tbuff);
1530  CopyInt(&pVision->_lflags, tbuff);
1531 }
1532 
1533 void SavePortal(int i)
1534 {
1535  PortalStruct *pPortal = &portal[i];
1536 
1537  CopyInt(&pPortal->open, tbuff);
1538  CopyInt(&pPortal->x, tbuff);
1539  CopyInt(&pPortal->y, tbuff);
1540  CopyInt(&pPortal->level, tbuff);
1541  CopyInt(&pPortal->ltype, tbuff);
1542  CopyInt(&pPortal->setlvl, tbuff);
1543 }
1544 
1546 {
1547  int i, j;
1548  char szName[MAX_PATH];
1549  int dwLen;
1550  BYTE *SaveBuff;
1551 
1552  if (!currlevel)
1553  glSeedTbl[0] = GetRndSeed();
1554 
1556  SaveBuff = DiabloAllocPtr(dwLen);
1557  tbuff = SaveBuff;
1558 
1559  if (leveltype != DTYPE_TOWN) {
1560  for (j = 0; j < MAXDUNY; j++) {
1561  for (i = 0; i < MAXDUNX; i++)
1562  BSave(dDead[i][j]);
1563  }
1564  }
1565 
1566  WSave(nummonsters);
1567  WSave(numitems);
1568  WSave(nobjects);
1569 
1570  if (leveltype != DTYPE_TOWN) {
1571  for (i = 0; i < MAXMONSTERS; i++)
1572  WSave(monstactive[i]);
1573  for (i = 0; i < nummonsters; i++)
1575  for (i = 0; i < MAXOBJECTS; i++)
1576  BSave(objectactive[i]);
1577  for (i = 0; i < MAXOBJECTS; i++)
1578  BSave(objectavail[i]);
1579  for (i = 0; i < nobjects; i++)
1581  }
1582 
1583  for (i = 0; i < MAXITEMS; i++)
1584  BSave(itemactive[i]);
1585  for (i = 0; i < MAXITEMS; i++)
1586  BSave(itemavail[i]);
1587  for (i = 0; i < numitems; i++)
1588  SaveItem(&item[itemactive[i]]);
1589 
1590  for (j = 0; j < MAXDUNY; j++) {
1591  for (i = 0; i < MAXDUNX; i++)
1593  }
1594  for (j = 0; j < MAXDUNY; j++) {
1595  for (i = 0; i < MAXDUNX; i++)
1596  BSave(dItem[i][j]);
1597  }
1598 
1599  if (leveltype != DTYPE_TOWN) {
1600  for (j = 0; j < MAXDUNY; j++) {
1601  for (i = 0; i < MAXDUNX; i++)
1602  WSave(dMonster[i][j]);
1603  }
1604  for (j = 0; j < MAXDUNY; j++) {
1605  for (i = 0; i < MAXDUNX; i++)
1606  BSave(dObject[i][j]);
1607  }
1608  for (j = 0; j < MAXDUNY; j++) {
1609  for (i = 0; i < MAXDUNX; i++)
1610  BSave(dLight[i][j]);
1611  }
1612  for (j = 0; j < MAXDUNY; j++) {
1613  for (i = 0; i < MAXDUNX; i++)
1614  BSave(dPreLight[i][j]);
1615  }
1616  for (j = 0; j < DMAXY; j++) {
1617  for (i = 0; i < DMAXX; i++)
1618  OSave(automapview[i][j]);
1619  }
1620  for (j = 0; j < MAXDUNY; j++) {
1621  for (i = 0; i < MAXDUNX; i++)
1622  BSave(dMissile[i][j]);
1623  }
1624  }
1625 
1626  GetTempLevelNames(szName);
1627  dwLen = codec_get_encoded_len(tbuff - SaveBuff);
1628  pfile_write_save_file(szName, SaveBuff, tbuff - SaveBuff, dwLen);
1629  mem_free_dbg(SaveBuff);
1630 
1631  if (!setlevel)
1632  plr[myplr]._pLvlVisited[currlevel] = TRUE;
1633  else
1634  plr[myplr]._pSLvlVisited[setlvlnum] = TRUE;
1635 }
1636 
1638 {
1639  int i, j;
1640  DWORD dwLen;
1641  char szName[MAX_PATH];
1642  BYTE *LoadBuff;
1643 
1644  GetPermLevelNames(szName);
1645  LoadBuff = pfile_read(szName, &dwLen);
1646  tbuff = LoadBuff;
1647 
1648  if (leveltype != DTYPE_TOWN) {
1649  for (j = 0; j < MAXDUNY; j++) {
1650  for (i = 0; i < MAXDUNX; i++)
1651  dDead[i][j] = BLoad();
1652  }
1653  SetDead();
1654  }
1655 
1656  nummonsters = WLoad();
1657  numitems = WLoad();
1658  nobjects = WLoad();
1659 
1660  if (leveltype != DTYPE_TOWN) {
1661  for (i = 0; i < MAXMONSTERS; i++)
1662  monstactive[i] = WLoad();
1663  for (i = 0; i < nummonsters; i++)
1665  for (i = 0; i < MAXOBJECTS; i++)
1666  objectactive[i] = BLoad();
1667  for (i = 0; i < MAXOBJECTS; i++)
1668  objectavail[i] = BLoad();
1669  for (i = 0; i < nobjects; i++)
1671  for (i = 0; i < nobjects; i++)
1673  }
1674 
1675  for (i = 0; i < MAXITEMS; i++)
1676  itemactive[i] = BLoad();
1677  for (i = 0; i < MAXITEMS; i++)
1678  itemavail[i] = BLoad();
1679  for (i = 0; i < numitems; i++)
1680  LoadItem(itemactive[i]);
1681 
1682  for (j = 0; j < MAXDUNY; j++) {
1683  for (i = 0; i < MAXDUNX; i++)
1684  dFlags[i][j] = BLoad();
1685  }
1686  for (j = 0; j < MAXDUNY; j++) {
1687  for (i = 0; i < MAXDUNX; i++)
1688  dItem[i][j] = BLoad();
1689  }
1690 
1691  if (leveltype != DTYPE_TOWN) {
1692  for (j = 0; j < MAXDUNY; j++) {
1693  for (i = 0; i < MAXDUNX; i++)
1694  dMonster[i][j] = WLoad();
1695  }
1696  for (j = 0; j < MAXDUNY; j++) {
1697  for (i = 0; i < MAXDUNX; i++)
1698  dObject[i][j] = BLoad();
1699  }
1700  for (j = 0; j < MAXDUNY; j++) {
1701  for (i = 0; i < MAXDUNX; i++)
1702  dLight[i][j] = BLoad();
1703  }
1704  for (j = 0; j < MAXDUNY; j++) {
1705  for (i = 0; i < MAXDUNX; i++)
1706  dPreLight[i][j] = BLoad();
1707  }
1708  for (j = 0; j < DMAXY; j++) {
1709  for (i = 0; i < DMAXX; i++)
1710  automapview[i][j] = OLoad();
1711  }
1712  for (j = 0; j < MAXDUNY; j++) {
1713  for (i = 0; i < MAXDUNX; i++)
1714  dMissile[i][j] = 0;
1715  }
1716  }
1717 
1718  AutomapZoomReset();
1719  ResyncQuests();
1720  SyncPortals();
1721  dolighting = TRUE;
1722 
1723  for (i = 0; i < MAX_PLRS; i++) {
1724  if (plr[i].plractive && currlevel == plr[i].plrlevel)
1725  LightList[plr[i]._plid]._lunflag = 1;
1726  }
1727 
1728  mem_free_dbg(LoadBuff);
1729 }
1730 
PlayerStruct::_pISplCost
char _pISplCost
Definition: structs.h:330
MonsterStruct::_mVar1
int _mVar1
Definition: structs.h:570
ItemStruct::_iSeed
int _iSeed
Definition: structs.h:100
SetDead
void SetDead()
Definition: dead.cpp:79
PlayerStruct::_pSpellFlags
UCHAR _pSpellFlags
Definition: structs.h:229
QuestStruct::_qtx
int _qtx
Definition: structs.h:975
MonsterStruct::mArmorClass
unsigned char mArmorClass
Definition: structs.h:603
ObjectStruct::_oVar3
int _oVar3
Definition: structs.h:682
PlayerStruct::_pManaBase
int _pManaBase
Definition: structs.h:261
CopyChar
void CopyChar(const void *src, void *dst)
Definition: loadsave.cpp:221
ItemStruct::_iAnimLen
int _iAnimLen
Definition: structs.h:107
pfile_write_save_file
void pfile_write_save_file(const char *pszName, BYTE *pbData, DWORD dwLen, DWORD qwLen)
Definition: pfile.cpp:507
SyncObjectAnim
void SyncObjectAnim(int o)
Definition: objects.cpp:4267
PlayerStruct::_pMagResist
char _pMagResist
Definition: structs.h:272
ItemStruct::offs016C
int offs016C
Definition: structs.h:171
SyncMonsterAnim
void SyncMonsterAnim(int i)
Definition: monster.cpp:4870
PlayerStruct::_pGold
int _pGold
Definition: structs.h:275
MissileStruct::_mispllvl
int _mispllvl
Definition: structs.h:420
MissileStruct::_misx
int _misx
Definition: structs.h:415
OSave
void OSave(BOOL v)
Definition: loadsave.cpp:991
quests
QuestStruct quests[MAXQUESTS]
Definition: quests.cpp:8
ItemStruct::_iLoc
char _iLoc
Definition: structs.h:118
MonsterStruct::_moldx
int _moldx
Definition: structs.h:552
ItemStruct::_iVAdd1
int _iVAdd1
Definition: structs.h:162
ItemStruct::_iy
int _iy
Definition: structs.h:104
MissileStruct::_miAnimFlags
int _miAnimFlags
Definition: structs.h:423
ItemStruct::_iMiscId
int _iMiscId
Definition: structs.h:130
MonsterStruct::_mAISeed
int _mAISeed
Definition: structs.h:589
MissileStruct::_miVar4
int _miVar4
Definition: structs.h:447
PlayerStruct::InvGrid
char InvGrid[NUM_INV_GRID_ELEM]
Definition: structs.h:316
OLoad
BOOL OLoad()
Definition: loadsave.cpp:207
MonsterStruct::_mAnimDelay
int _mAnimDelay
Definition: structs.h:564
MonsterStruct::_mVar5
int _mVar5
Definition: structs.h:574
ItemStruct::_iPLDex
int _iPLDex
Definition: structs.h:142
RedoPlayerVision
void RedoPlayerVision()
Definition: objects.cpp:1979
ObjectStruct::_oVar5
int _oVar5
Definition: structs.h:684
ItemStruct::_iSpell
int _iSpell
Definition: structs.h:132
PlayerStruct::pLvlLoad
unsigned char pLvlLoad
Definition: structs.h:340
PlayerStruct::_pBaseStr
int _pBaseStr
Definition: structs.h:246
PlayerStruct::_pMaxLvl
char _pMaxLvl
Definition: structs.h:267
PlayerStruct::_pIGetHit
int _pIGetHit
Definition: structs.h:328
SyncPortals
void SyncPortals()
Definition: portal.cpp:53
ItemStruct::_iMinStr
char _iMinStr
Definition: structs.h:166
PlayerStruct::_pgfxnum
int _pgfxnum
Definition: structs.h:204
GetItemFrm
void GetItemFrm(int i)
Definition: items.cpp:2491
MonsterStruct::_mAnimLen
int _mAnimLen
Definition: structs.h:566
PlayerStruct::_pAnimFrame
int _pAnimFrame
Definition: structs.h:209
MonsterStruct::_mint
unsigned char _mint
Definition: structs.h:581
currlevel
BYTE currlevel
Definition: gendung.cpp:40
PlayerStruct::_pMaxHP
int _pMaxHP
Definition: structs.h:259
ObjectStruct::_olid
int _olid
Definition: structs.h:678
PlayerStruct::_pMana
int _pMana
Definition: structs.h:263
ItemStruct::_iCurs
int _iCurs
Definition: structs.h:121
PlayerStruct::_ptargx
int _ptargx
Definition: structs.h:192
ItemStruct::_ix
int _ix
Definition: structs.h:103
MissileStruct::_miAnimWidth
int _miAnimWidth
Definition: structs.h:427
BLoad
char BLoad()
Definition: loadsave.cpp:182
numlights
int numlights
Definition: lighting.cpp:13
MAXPORTAL
#define MAXPORTAL
Definition: defs.h:34
MonsterStruct::mHit
unsigned char mHit
Definition: structs.h:597
MonsterStruct::_mAi
unsigned char _mAi
Definition: structs.h:580
AutoMapScale
int AutoMapScale
Specifies the scale of the automap.
Definition: automap.cpp:23
PlayerStruct::_pxoff
int _pxoff
Definition: structs.h:198
ReturnLvlY
int ReturnLvlY
Definition: quests.cpp:13
SetCursor_
void SetCursor_(int i)
Definition: cursor.cpp:99
ItemStruct::_iPLAC
int _iPLAC
Definition: structs.h:139
PlayerStruct::destAction
int destAction
Definition: structs.h:182
PlayerStruct::pTownWarps
unsigned char pTownWarps
Definition: structs.h:338
ObjectStruct::_oVar7
int _oVar7
Definition: structs.h:686
NUM_INVLOC
@ NUM_INVLOC
Definition: enums.h:2796
MAX_PLRS
#define MAX_PLRS
Definition: defs.h:16
PlayerStruct::_pAnimCnt
int _pAnimCnt
Definition: structs.h:207
MAXMISSILES
#define MAXMISSILES
Definition: defs.h:30
MonsterStruct::mlid
unsigned char mlid
Definition: structs.h:610
PlayerStruct::destParam3
int destParam3
Definition: structs.h:185
MonsterStruct::_udeadval
char _udeadval
Definition: structs.h:593
PlayerStruct::pManaShield
BOOLEAN pManaShield
Definition: structs.h:342
PlayerStruct::_pSpell
int _pSpell
Definition: structs.h:215
PlayerStruct::_pAnimLen
int _pAnimLen
Definition: structs.h:208
ItemStruct::_iLMinDam
int _iLMinDam
Definition: structs.h:157
MissileStruct::_mirange
int _mirange
Definition: structs.h:436
MonsterStruct::_mmaxhp
int _mmaxhp
Definition: structs.h:578
MonsterStruct::_mRndSeed
int _mRndSeed
Definition: structs.h:588
premiumlevel
int premiumlevel
Definition: stores.cpp:12
MonsterStruct::_mVar8
int _mVar8
Definition: structs.h:577
UniqueItemFlag
BOOL UniqueItemFlag[128]
Definition: items.cpp:18
PlayerStruct::_pMaxHPBase
int _pMaxHPBase
Definition: structs.h:257
MonsterStruct::_mVar2
int _mVar2
Definition: structs.h:571
MissileStruct::_miDrawFlag
BOOL _miDrawFlag
Definition: structs.h:432
PlayerStruct::_pBaseDex
int _pBaseDex
Definition: structs.h:250
PlayerStruct::_pAFrames
int _pAFrames
Definition: structs.h:295
PlayerStruct::_pIBonusDamMod
int _pIBonusDamMod
Definition: structs.h:325
numvision
int numvision
Definition: lighting.cpp:16
ItemStruct::_iSelFlag
char _iSelFlag
Definition: structs.h:112
MonsterStruct::mMaxDamage2
unsigned char mMaxDamage2
Definition: structs.h:602
MonsterStruct::falign_CB
char falign_CB
Definition: structs.h:604
ItemStruct::_iStatFlag
BOOL _iStatFlag
Definition: structs.h:169
nobjects
int nobjects
Definition: objects.cpp:10
ObjectStruct::_oLight
int _oLight
Definition: structs.h:661
MonsterStruct::mExp
unsigned short mExp
Definition: structs.h:596
MissileStruct::_miVar2
int _miVar2
Definition: structs.h:445
SwapLE16
#define SwapLE16
Definition: defs.h:183
LoadLevel
void LoadLevel()
Definition: loadsave.cpp:1637
PlayerStruct::_pVar3
int _pVar3
Definition: structs.h:279
ObjectStruct::_oAnimFlag
int _oAnimFlag
Definition: structs.h:662
PlayerStruct::_pNumInv
int _pNumInv
Definition: structs.h:315
ObjectStruct::_oTrapFlag
BOOL _oTrapFlag
Definition: structs.h:676
MissileStruct::_mimfnum
int _mimfnum
Definition: structs.h:419
PlayerStruct::WorldX
int WorldX
Definition: structs.h:188
LightListStruct::_ly
int _ly
Definition: structs.h:1180
MissileStruct::_midam
int _midam
Definition: structs.h:439
LoadItemData
void LoadItemData(ItemStruct *pItem)
Definition: loadsave.cpp:662
PlayerStruct::_pAblSpells
uint64_t _pAblSpells
Definition: structs.h:227
PlayerStruct::_pHPBase
int _pHPBase
Definition: structs.h:256
ItemStruct::_iIvalue
int _iIvalue
Definition: structs.h:123
PlayerStruct::_pRSpell
int _pRSpell
Definition: structs.h:220
SaveLevel
void SaveLevel()
Definition: loadsave.cpp:1545
PlayerStruct::_pIFlags
int _pIFlags
Definition: structs.h:327
CURSOR_HAND
@ CURSOR_HAND
Definition: enums.h:2067
MAXDUNX
#define MAXDUNX
Definition: defs.h:25
ItemStruct::_iDurability
int _iDurability
Definition: structs.h:135
ItemStruct::_iMinDam
int _iMinDam
Definition: structs.h:124
MissileStruct::_miHitFlag
BOOL _miHitFlag
Definition: structs.h:440
SMITH_PREMIUM_ITEMS
#define SMITH_PREMIUM_ITEMS
Definition: defs.h:58
ItemStruct::_iMinMag
unsigned char _iMinMag
Definition: structs.h:167
CopyShorts
void CopyShorts(const void *src, const int n, void *dst)
Definition: loadsave.cpp:236
PlayerStruct::_pAWidth
int _pAWidth
Definition: structs.h:296
PlayerStruct::_pAnimWidth2
int _pAnimWidth2
Definition: structs.h:211
PlayerStruct::_pBaseToBlk
int _pBaseToBlk
Definition: structs.h:255
PlayerStruct::_plid
int _plid
Definition: structs.h:213
ItemStruct::_iAnimWidth2
int _iAnimWidth2
Definition: structs.h:110
ItemStruct::_iLMaxDam
int _iLMaxDam
Definition: structs.h:158
item
ItemStruct item[MAXITEMS+1]
Definition: items.cpp:15
PlayerStruct::_pISpells
uint64_t _pISpells
Definition: structs.h:326
MAXITEMS
#define MAXITEMS
Definition: defs.h:27
MonsterStruct::_mfutx
int _mfutx
Definition: structs.h:550
PLR_NAME_LEN
#define PLR_NAME_LEN
Definition: defs.h:70
ItemStruct::_iFlags
int _iFlags
Definition: structs.h:128
ItemStruct::_itype
int _itype
Definition: structs.h:102
MonsterStruct::_mAnimFrame
int _mAnimFrame
Definition: structs.h:567
GetPermLevelNames
void GetPermLevelNames(char *szPerm)
Definition: pfile.cpp:409
PlayerStruct::_pIEnAc
int _pIEnAc
Definition: structs.h:332
PlayerStruct::HoldItem
ItemStruct HoldItem
Definition: structs.h:318
PlayerStruct::_nextdir
int _nextdir
Definition: structs.h:203
MonsterStruct::_mDelFlag
BOOL _mDelFlag
Definition: structs.h:569
PlayerStruct::_pWWidth
int _pWWidth
Definition: structs.h:293
PlayerStruct::_pNFrames
int _pNFrames
Definition: structs.h:289
MonsterStruct::_mgoal
unsigned char _mgoal
Definition: structs.h:542
MonsterStruct::falign_A4
int falign_A4
Definition: structs.h:585
itemactive
DEVILUTION_BEGIN_NAMESPACE int itemactive[MAXITEMS]
Definition: items.cpp:10
ItemStruct::_iFMaxDam
int _iFMaxDam
Definition: structs.h:156
ItemStruct::_iPLDam
int _iPLDam
Definition: structs.h:137
ResyncQuests
void ResyncQuests()
Definition: quests.cpp:613
ViewX
int ViewX
Definition: gendung.cpp:73
MonsterStruct::falign_52
short falign_52
Definition: structs.h:562
missile
MissileStruct missile[MAXMISSILES]
Definition: missiles.cpp:12
PlayerStruct::_pVar2
int _pVar2
Definition: structs.h:278
PlayerStruct::_poldy
int _poldy
Definition: structs.h:197
MissileStruct::_mirnd
int _mirnd
Definition: structs.h:443
MonsterStruct::_mmode
int _mmode
Definition: structs.h:541
LightListStruct::_lunr
int _lunr
Definition: structs.h:1188
PlayerStruct::_pSplLvl
char _pSplLvl[64]
Definition: structs.h:225
WSave
void WSave(int v)
Definition: loadsave.cpp:975
portal
DEVILUTION_BEGIN_NAMESPACE PortalStruct portal[MAXPORTAL]
In-game state of portals.
Definition: portal.cpp:6
MonsterStruct::mLevel
char mLevel
Definition: structs.h:595
LightList
LightListStruct LightList[MAXLIGHTS]
Definition: lighting.cpp:12
PlayerStruct::_pNextExper
int _pNextExper
Definition: structs.h:270
PlayerStruct::InvList
ItemStruct InvList[NUM_INV_GRID_ELEM]
Definition: structs.h:314
PlayerStruct::_pVitality
int _pVitality
Definition: structs.h:251
MonsterStruct::_uniqtype
unsigned char _uniqtype
Definition: structs.h:591
MAX_PATH_LENGTH
#define MAX_PATH_LENGTH
Definition: defs.h:74
SaveVision
void SaveVision(int i)
Definition: loadsave.cpp:1514
ObjectStruct::_oBreak
char _oBreak
Definition: structs.h:671
LoadPlayer
void LoadPlayer(int i)
Definition: loadsave.cpp:274
ObjectStruct::_oPreFlag
BOOL _oPreFlag
Definition: structs.h:675
ObjectStruct::_oVar2
int _oVar2
Definition: structs.h:681
QuestStruct::_qlevel
unsigned char _qlevel
Definition: structs.h:971
SaveGame
void SaveGame()
Definition: loadsave.cpp:827
MonsterStruct::mtalkmsg
int mtalkmsg
Definition: structs.h:606
PlayerStruct::_pBWidth
int _pBWidth
Definition: structs.h:312
gnLevelTypeTbl
int gnLevelTypeTbl[NUMLEVELS]
Definition: diablo.cpp:16
PlayerStruct::_pIBonusToHit
int _pIBonusToHit
Definition: structs.h:323
CopyInts
void CopyInts(const void *src, const int n, void *dst)
Definition: loadsave.cpp:255
ObjectStruct::_oSelFlag
char _oSelFlag
Definition: structs.h:674
ItemStruct::_iPLVit
int _iPLVit
Definition: structs.h:143
automapflag
BOOL automapflag
Specifies whether the automap is enabled.
Definition: automap.cpp:18
PlayerStruct::_pHWidth
int _pHWidth
Definition: structs.h:306
PlayerStruct::_pNWidth
int _pNWidth
Definition: structs.h:290
PlayerStruct::_pExperience
int _pExperience
Definition: structs.h:268
PlayerStruct::_pdir
int _pdir
Definition: structs.h:202
CopyInt64
void CopyInt64(const void *src, void *dst)
Definition: loadsave.cpp:265
MonsterStruct::_mx
int _mx
Definition: structs.h:548
visionid
int visionid
Definition: lighting.cpp:20
MissileStruct::_miPreFlag
BOOL _miPreFlag
Definition: structs.h:434
PlayerStruct::_pLevel
char _pLevel
Definition: structs.h:266
MonsterStruct::_mMTidx
int _mMTidx
Definition: structs.h:540
ItemStruct::_ivalue
int _ivalue
Definition: structs.h:122
MissileStruct::_miAnimLen
int _miAnimLen
Definition: structs.h:426
MissileStruct::_mixoff
int _mixoff
Definition: structs.h:411
all.h
MissileStruct::_mitxoff
int _mitxoff
Definition: structs.h:417
ViewY
int ViewY
Definition: gendung.cpp:74
SavePlayer
void SavePlayer(int i)
Definition: loadsave.cpp:999
QuestStruct::_qactive
unsigned char _qactive
Definition: structs.h:973
pfile_rename_temp_to_perm
void pfile_rename_temp_to_perm()
Definition: pfile.cpp:463
PortalStruct::y
int y
Definition: structs.h:697
MissileStruct::_miy
int _miy
Definition: structs.h:410
PlayerStruct::SpdList
ItemStruct SpdList[MAXBELTITEMS]
Definition: structs.h:317
objectavail
int objectavail[MAXOBJECTS]
Definition: objects.cpp:12
LightListStruct::_lflags
int _lflags
Definition: structs.h:1191
PlayerStruct::_pAFNum
int _pAFNum
Definition: structs.h:297
ItemStruct::_iMagical
char _iMagical
Definition: structs.h:115
PlayerStruct::_pIMaxDam
int _pIMaxDam
Definition: structs.h:320
PlayerStruct::_pSplType
char _pSplType
Definition: structs.h:216
dObject
char dObject[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:19
PlayerStruct::wReserved
short wReserved[8]
Definition: structs.h:344
MonsterStruct::mMinDamage
unsigned char mMinDamage
Definition: structs.h:598
PlayerStruct::_pOilType
int _pOilType
Definition: structs.h:337
premiumitem
ItemStruct premiumitem[SMITH_PREMIUM_ITEMS]
Definition: stores.cpp:10
PlayerStruct::walkpath
char walkpath[MAX_PATH_LENGTH]
Definition: structs.h:180
ObjectStruct::_oDoorFlag
BOOL _oDoorFlag
Definition: structs.h:677
PlayerStruct::_pIFMinDam
int _pIFMinDam
Definition: structs.h:333
PortalStruct::ltype
int ltype
Definition: structs.h:699
PlayerStruct::_pVar1
int _pVar1
Definition: structs.h:277
PlayerStruct::destParam4
int destParam4
Definition: structs.h:186
PlayerStruct::destParam1
int destParam1
Definition: structs.h:183
PlayerStruct::_pMagic
int _pMagic
Definition: structs.h:247
SaveItems
void SaveItems(ItemStruct *pItem, const int n)
Definition: loadsave.cpp:1458
MonsterStruct::_myvel
int _myvel
Definition: structs.h:557
PlayerStruct::_pSFNum
int _pSFNum
Definition: structs.h:303
ObjectStruct::_oAnimWidth
int _oAnimWidth
Definition: structs.h:668
MAXLIGHTS
#define MAXLIGHTS
Definition: defs.h:29
PlayerStruct::_pClass
char _pClass
Definition: structs.h:244
MAXBELTITEMS
#define MAXBELTITEMS
Definition: defs.h:28
ItemStruct
Definition: structs.h:99
PlayerStruct::_pSplHotKey
int _pSplHotKey[4]
Definition: structs.h:230
ItemStruct::_iVMult2
int _iVMult2
Definition: structs.h:165
ItemStruct::_iPLToHit
int _iPLToHit
Definition: structs.h:138
PlayerStruct::_pownerx
int _pownerx
Definition: structs.h:194
MonsterStruct::_lasty
int _lasty
Definition: structs.h:587
MonsterStruct::_mgoalvar3
int _mgoalvar3
Definition: structs.h:545
PlayerStruct::_pLvlVisited
BOOLEAN _pLvlVisited[NUMLEVELS]
Definition: structs.h:285
PlayerStruct::destParam2
int destParam2
Definition: structs.h:184
missileavail
int missileavail[MAXMISSILES]
Definition: missiles.cpp:11
ItemStruct::_iMaxDur
int _iMaxDur
Definition: structs.h:136
LoadQuest
void LoadQuest(int i)
Definition: loadsave.cpp:752
SavePortal
void SavePortal(int i)
Definition: loadsave.cpp:1533
MAXDUNY
#define MAXDUNY
Definition: defs.h:26
PlayerStruct::_px
int _px
Definition: structs.h:190
PlayerStruct::_pSWidth
int _pSWidth
Definition: structs.h:302
MissileStruct::_miyoff
int _miyoff
Definition: structs.h:412
PlayerStruct::_pSBkSpell
int _pSBkSpell
Definition: structs.h:223
MissileStruct::_miAnimCnt
int _miAnimCnt
Definition: structs.h:429
dLight
char dLight[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:27
ItemStruct::_iAnimFrame
int _iAnimFrame
Definition: structs.h:108
ItemStruct::_iPLHP
int _iPLHP
Definition: structs.h:148
PlayerStruct::_pTSplType
char _pTSplType
Definition: structs.h:219
PlayerStruct::_pMaxExp
int _pMaxExp
Definition: structs.h:269
PortalStruct
Definition: structs.h:694
PlayerStruct::_pMaxMana
int _pMaxMana
Definition: structs.h:264
LoadMissile
void LoadMissile(int i)
Definition: loadsave.cpp:566
gbProcessPlayers
BOOL gbProcessPlayers
Definition: diablo.cpp:25
MissileStruct::_mitype
int _mitype
Definition: structs.h:408
PlayerStruct::_pSBkSplType
char _pSBkSplType
Definition: structs.h:224
ItemStruct::_iVMult1
int _iVMult1
Definition: structs.h:163
ProcessLightList
void ProcessLightList()
Definition: lighting.cpp:1116
MonsterStruct::_mdir
int _mdir
Definition: structs.h:558
MissileStruct::_miUniqTrans
int _miUniqTrans
Definition: structs.h:435
MonsterStruct::_mxoff
int _mxoff
Definition: structs.h:554
PlayerStruct::_pLightRad
char _pLightRad
Definition: structs.h:235
PortalStruct::setlvl
BOOL setlvl
Definition: structs.h:700
LightListStruct::_lunflag
int _lunflag
Definition: structs.h:1184
ObjectStruct::_oAnimDelay
int _oAnimDelay
Definition: structs.h:664
ItemStruct::_iUid
int _iUid
Definition: structs.h:154
MonsterStruct::_mgoalvar1
int _mgoalvar1
Definition: structs.h:543
PlayerStruct::_pGFXLoad
int _pGFXLoad
Definition: structs.h:287
MissileStruct::_miLightFlag
BOOL _miLightFlag
Definition: structs.h:433
ItemStruct::_iClass
char _iClass
Definition: structs.h:120
ObjectStruct::_oAnimWidth2
int _oAnimWidth2
Definition: structs.h:669
PlayerStruct::_pFireResist
char _pFireResist
Definition: structs.h:273
SyncInitPlr
void SyncInitPlr(int pnum)
Definition: player.cpp:3788
LoadItems
void LoadItems(const int n, ItemStruct *pItem)
Definition: loadsave.cpp:740
ReturnLvlT
int ReturnLvlT
Definition: quests.cpp:15
MonsterStruct::_mVar4
int _mVar4
Definition: structs.h:573
app_fatal
void app_fatal(const char *pszFmt,...)
Definition: appfat.cpp:18
pfile_write_hero
void pfile_write_hero()
Definition: pfile.cpp:20
dolighting
BOOL dolighting
Definition: lighting.cpp:18
ObjectStruct::_oMissFlag
BOOL _oMissFlag
Definition: structs.h:673
DEVILUTION_END_NAMESPACE
#define DEVILUTION_END_NAMESPACE
Definition: types.h:10
MonsterStruct::packsize
unsigned char packsize
Definition: structs.h:609
ItemStruct::_iRequest
char _iRequest
Definition: structs.h:153
MissileStruct::_mixvel
int _mixvel
Definition: structs.h:413
LightListStruct::_yoff
int _yoff
Definition: structs.h:1190
PlayerStruct::_pvid
int _pvid
Definition: structs.h:214
MissileStruct::_misy
int _misy
Definition: structs.h:416
SyncPlrAnim
void SyncPlrAnim(int pnum)
Definition: player.cpp:3681
monster
MonsterStruct monster[MAXMONSTERS]
Definition: monster.cpp:19
MissileStruct::_miyvel
int _miyvel
Definition: structs.h:414
PlayerStruct::_pISplLvlAdd
char _pISplLvlAdd
Definition: structs.h:329
MonsterStruct::_mhitpoints
int _mhitpoints
Definition: structs.h:579
LoadPortal
void LoadPortal(int i)
Definition: loadsave.cpp:815
ObjectStruct::_oVar4
int _oVar4
Definition: structs.h:683
WLoad
int WLoad()
Definition: loadsave.cpp:187
ISave
void ISave(int v)
Definition: loadsave.cpp:983
MonsterStruct::leaderflag
unsigned char leaderflag
Definition: structs.h:608
ItemStruct::_iAnimFlag
BOOL _iAnimFlag
Definition: structs.h:105
PlayerStruct::_pDamageMod
int _pDamageMod
Definition: structs.h:254
LightListStruct::_lradius
int _lradius
Definition: structs.h:1181
PlayerStruct::_pVar6
int _pVar6
Definition: structs.h:282
LoadItem
void LoadItem(int i)
Definition: loadsave.cpp:656
PlayerStruct::_pInvincible
BOOLEAN _pInvincible
Definition: structs.h:234
PlayerStruct::pDiabloKillLevel
DWORD pDiabloKillLevel
Definition: structs.h:345
MonsterStruct::falign_B8
int falign_B8
Definition: structs.h:590
ObjectStruct::_oVar1
int _oVar1
Definition: structs.h:680
NUMLEVELS
#define NUMLEVELS
Definition: defs.h:56
MissileStruct::_mlid
int _mlid
Definition: structs.h:442
MonsterStruct::mMinDamage2
unsigned char mMinDamage2
Definition: structs.h:601
PlayerStruct::_pBaseMag
int _pBaseMag
Definition: structs.h:248
MissileStruct::_miVar8
int _miVar8
Definition: structs.h:451
MonsterStruct::_mxvel
int _mxvel
Definition: structs.h:556
ItemStruct::_iPLLR
int _iPLLR
Definition: structs.h:145
dMissile
char dMissile[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:76
PlayerStruct::plractive
BOOLEAN plractive
Definition: structs.h:181
MissileStruct::_miVar6
int _miVar6
Definition: structs.h:449
LoadGame
void LoadGame(BOOL firstflag)
Definition: loadsave.cpp:12
MonsterStruct::mWhoHit
char mWhoHit
Definition: structs.h:594
ItemStruct::_iAnimWidth
int _iAnimWidth
Definition: structs.h:109
dItem
char dItem[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:57
MissileStruct::_miVar1
int _miVar1
Definition: structs.h:444
PlayerStruct::_pLvlChanging
BOOLEAN _pLvlChanging
Definition: structs.h:236
SaveQuest
void SaveQuest(int i)
Definition: loadsave.cpp:1470
MonsterStruct::_menemyx
unsigned char _menemyx
Definition: structs.h:560
MonsterStruct::mMaxDamage
unsigned char mMaxDamage
Definition: structs.h:599
FreeGameMem
void FreeGameMem()
Definition: diablo.cpp:89
PlayerStruct::_pIAC
int _pIAC
Definition: structs.h:321
ObjectStruct::_oAnimFrame
int _oAnimFrame
Definition: structs.h:667
PlayerStruct::_pxvel
int _pxvel
Definition: structs.h:200
objectactive
int objectactive[MAXOBJECTS]
Definition: objects.cpp:9
LightListStruct::_ldel
int _ldel
Definition: structs.h:1183
ItemStruct::_iSplLvlAdd
char _iSplLvlAdd
Definition: structs.h:152
BSave
void BSave(char v)
Definition: loadsave.cpp:970
PlayerStruct::_pSFrames
int _pSFrames
Definition: structs.h:301
LoadObject
void LoadObject(int i)
Definition: loadsave.cpp:617
BFLAG_DEAD_PLAYER
@ BFLAG_DEAD_PLAYER
Definition: enums.h:1879
FILEBUFF
#define FILEBUFF
Definition: defs.h:78
QuestStruct::_qmsg
unsigned char _qmsg
Definition: structs.h:979
PlayerStruct::_pMaxManaBase
int _pMaxManaBase
Definition: structs.h:262
MissileStruct::_mityoff
int _mityoff
Definition: structs.h:418
PlayerStruct::_pLghtResist
char _pLghtResist
Definition: structs.h:274
missileactive
DEVILUTION_BEGIN_NAMESPACE int missileactive[MAXMISSILES]
Definition: missiles.cpp:10
PlayerStruct::_pSLvlVisited
BOOLEAN _pSLvlVisited[NUMLEVELS]
Definition: structs.h:286
GetRndSeed
int GetRndSeed()
Get the current RNG seed.
Definition: engine.cpp:739
MonsterStruct::leader
unsigned char leader
Definition: structs.h:607
PlayerStruct::_pownery
int _pownery
Definition: structs.h:195
MissileStruct::_mix
int _mix
Definition: structs.h:409
numpremium
int numpremium
Definition: stores.cpp:22
PlayerStruct::_pMemSpells
uint64_t _pMemSpells
Definition: structs.h:226
SaveItem
void SaveItem(ItemStruct *pItem)
Definition: loadsave.cpp:1380
MonsterStruct::_mVar3
int _mVar3
Definition: structs.h:572
MonsterStruct::_mFlags
int _mFlags
Definition: structs.h:583
pfile_read
BYTE * pfile_read(const char *pszName, DWORD *pdwLen)
Definition: pfile.cpp:532
MonsterStruct::_menemyy
unsigned char _menemyy
Definition: structs.h:561
pfile_get_game_name
void pfile_get_game_name(char *dst)
Definition: pfile.cpp:429
ItemStruct::_iCharges
int _iCharges
Definition: structs.h:133
MonsterStruct::falign_9A
short falign_9A
Definition: structs.h:582
QuestStruct
Definition: structs.h:970
PlayerStruct::_pBlockFlag
BOOLEAN _pBlockFlag
Definition: structs.h:233
codec_get_encoded_len
DWORD codec_get_encoded_len(DWORD dwSrcBytes)
Definition: codec.cpp:96
PlayerStruct::_ptargy
int _ptargy
Definition: structs.h:193
GetTempLevelNames
void GetTempLevelNames(char *szTemp)
Definition: pfile.cpp:399
MissileStruct::_midist
int _midist
Definition: structs.h:441
MonsterStruct::_pathcount
unsigned char _pathcount
Definition: structs.h:547
ItemStruct::_iName
char _iName[64]
Definition: structs.h:116
SaveMonster
void SaveMonster(int i)
Definition: loadsave.cpp:1198
PortalStruct::level
int level
Definition: structs.h:698
VisionList
DEVILUTION_BEGIN_NAMESPACE LightListStruct VisionList[MAXVISION]
Definition: lighting.cpp:10
setlevel
BOOLEAN setlevel
Definition: gendung.cpp:65
ItemStruct::_iPLEnAc
int _iPLEnAc
Definition: structs.h:159
MonsterStruct::field_18
int field_18
Definition: structs.h:546
ItemStruct::_iIdentified
BOOL _iIdentified
Definition: structs.h:114
PlayerStruct::_pIBonusDam
int _pIBonusDam
Definition: structs.h:322
LoadGameLevel
void LoadGameLevel(BOOL firstflag, int lvldir)
Definition: diablo.cpp:1447
QuestStruct::_qslvl
unsigned char _qslvl
Definition: structs.h:977
MissileStruct
Definition: structs.h:407
LightListStruct::_lunx
int _lunx
Definition: structs.h:1186
SavePremium
void SavePremium(int i)
Definition: loadsave.cpp:1465
PlayerStruct::_poldx
int _poldx
Definition: structs.h:196
automapview
BOOLEAN automapview[DMAXX][DMAXY]
Tracks the explored areas of the map.
Definition: automap.cpp:21
DMAXY
#define DMAXY
Definition: defs.h:8
MAXOBJECTS
#define MAXOBJECTS
Definition: defs.h:33
DTYPE_TOWN
@ DTYPE_TOWN
Definition: enums.h:1868
MissileStruct::_miAnimDelay
int _miAnimDelay
Definition: structs.h:425
numitems
int numitems
Definition: items.cpp:19
PlayerStruct::_pIMinDam
int _pIMinDam
Definition: structs.h:319
MAXQUESTS
#define MAXQUESTS
Definition: defs.h:35
monstkills
int monstkills[MAXMONSTERS]
Definition: monster.cpp:15
PlayerStruct::_pTSpell
int _pTSpell
Definition: structs.h:218
LoadPremium
void LoadPremium(int i)
Definition: loadsave.cpp:747
CopyBytes
void CopyBytes(const void *src, const int n, void *dst)
Definition: loadsave.cpp:215
monstactive
int monstactive[MAXMONSTERS]
Definition: monster.cpp:16
MonsterStruct::_mVar7
int _mVar7
Definition: structs.h:576
MonsterStruct::_msquelch
BYTE _msquelch
Definition: structs.h:584
invflag
DEVILUTION_BEGIN_NAMESPACE BOOL invflag
Definition: inv.cpp:10
PlayerStruct::_pAnimWidth
int _pAnimWidth
Definition: structs.h:210
ProcessVisionList
void ProcessVisionList()
Definition: lighting.cpp:1229
dPreLight
char dPreLight[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:22
glSeedTbl
DWORD glSeedTbl[NUMLEVELS]
Definition: diablo.cpp:20
ObjectStruct::_otype
int _otype
Definition: structs.h:658
ItemStruct::_iFMinDam
int _iFMinDam
Definition: structs.h:155
LightListStruct::field_18
int field_18
Definition: structs.h:1185
PlayerStruct::_pDWidth
int _pDWidth
Definition: structs.h:309
nummonsters
int nummonsters
Definition: monster.cpp:17
MissileStruct::_miAnimAdd
int _miAnimAdd
Definition: structs.h:430
PlayerStruct::_pInfraFlag
BOOL _pInfraFlag
Definition: structs.h:276
SaveMissile
void SaveMissile(int i)
Definition: loadsave.cpp:1290
DiabloAllocPtr
BYTE * DiabloAllocPtr(DWORD dwBytes)
Multithreaded safe malloc.
Definition: engine.cpp:765
PortalStruct::open
BOOL open
Definition: structs.h:695
PlayerStruct::InvBody
ItemStruct InvBody[NUM_INVLOC]
Definition: structs.h:313
PortalStruct::x
int x
Definition: structs.h:696
MissileStruct::_miAnimFrame
int _miAnimFrame
Definition: structs.h:431
PlayerStruct::_pStatPts
int _pStatPts
Definition: structs.h:253
MissileStruct::_miVar5
int _miVar5
Definition: structs.h:448
SwapLE32
#define SwapLE32
Definition: defs.h:182
MissileStruct::_miVar7
int _miVar7
Definition: structs.h:450
MonsterStruct::_moldy
int _moldy
Definition: structs.h:553
PlayerStruct::_pIBonusAC
int _pIBonusAC
Definition: structs.h:324
setlvlnum
BYTE setlvlnum
Definition: gendung.cpp:58
MonsterStruct
Definition: structs.h:539
PlayerStruct::dwReserved
int dwReserved[7]
Definition: structs.h:346
ResetPal
void ResetPal()
Definition: palette.cpp:112
ItemStruct::IDidx
int IDidx
Definition: structs.h:170
pfile_remove_temp_files
void pfile_remove_temp_files()
Definition: pfile.cpp:436
ItemStruct::_iPostDraw
BOOL _iPostDraw
Definition: structs.h:113
chrflag
BOOL chrflag
Definition: control.cpp:49
PlayerStruct::_pVar5
int _pVar5
Definition: structs.h:281
ObjectStruct::_oDelFlag
BOOL _oDelFlag
Definition: structs.h:670
PlayerStruct::_pIFMaxDam
int _pIFMaxDam
Definition: structs.h:334
QuestStruct::_qty
int _qty
Definition: structs.h:976
PlayerStruct::_pyoff
int _pyoff
Definition: structs.h:199
myplr
int myplr
Definition: player.cpp:9
PlayerStruct::pDungMsgs
unsigned char pDungMsgs
Definition: structs.h:339
lightactive
BYTE lightactive[MAXLIGHTS]
Definition: lighting.cpp:11
MonsterStruct::_uniqtrans
unsigned char _uniqtrans
Definition: structs.h:592
ReturnLvlX
int ReturnLvlX
Definition: quests.cpp:14
PlayerStruct::_pAnimDelay
int _pAnimDelay
Definition: structs.h:206
PlayerStruct::_pHitPoints
int _pHitPoints
Definition: structs.h:258
CopyInt
void CopyInt(const void *src, void *dst)
Definition: loadsave.cpp:246
MissileStruct::_miAnimWidth2
int _miAnimWidth2
Definition: structs.h:428
ItemStruct::_iPLDamMod
int _iPLDamMod
Definition: structs.h:149
ItemStruct::_iPLMR
int _iPLMR
Definition: structs.h:146
mem_free_dbg
void mem_free_dbg(void *p)
Multithreaded safe memfree.
Definition: engine.cpp:786
ItemStruct::_iIName
char _iIName[64]
Definition: structs.h:117
ItemStruct::_iMaxCharges
int _iMaxCharges
Definition: structs.h:134
DoomQuestState
int DoomQuestState
Definition: doom.cpp:14
AutomapZoomReset
void AutomapZoomReset()
Definition: automap.cpp:653
nummissiles
int nummissiles
Definition: missiles.cpp:13
PlayerStruct::_pVar7
int _pVar7
Definition: structs.h:283
LightListStruct::_lx
int _lx
Definition: structs.h:1179
ItemStruct::_iPLMag
int _iPLMag
Definition: structs.h:141
QuestStruct::_qvar1
unsigned char _qvar1
Definition: structs.h:980
PlayerStruct::plrlevel
int plrlevel
Definition: structs.h:187
PlayerStruct::_pISplDur
int _pISplDur
Definition: structs.h:331
PlayerStruct::_pDFrames
int _pDFrames
Definition: structs.h:308
PlayerStruct::_pStrength
int _pStrength
Definition: structs.h:245
SaveObject
void SaveObject(int i)
Definition: loadsave.cpp:1341
PlayerStruct::_pScrlSpells
uint64_t _pScrlSpells
Definition: structs.h:228
QuestStruct::_qlvltype
unsigned char _qlvltype
Definition: structs.h:974
PlayerStruct::pBattleNet
unsigned char pBattleNet
Definition: structs.h:341
LightListStruct::_xoff
int _xoff
Definition: structs.h:1189
LoadMonster
void LoadMonster(int i)
Definition: loadsave.cpp:472
LoadVision
void LoadVision(int i)
Definition: loadsave.cpp:796
MissileStruct::_miVar3
int _miVar3
Definition: structs.h:446
PlayerStruct::_pVar4
int _pVar4
Definition: structs.h:280
MonsterStruct::_myoff
int _myoff
Definition: structs.h:555
dMonster
int dMonster[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:17
gbValidSaveFile
BOOL gbValidSaveFile
Definition: pfile.cpp:18
ItemStruct::_iAC
int _iAC
Definition: structs.h:126
LoadLighting
void LoadLighting(int i)
Definition: loadsave.cpp:777
DEVILUTION_BEGIN_NAMESPACE
Definition: sha.cpp:10
QuestStruct::_qlog
int _qlog
Definition: structs.h:982
MonsterStruct::_mfuty
int _mfuty
Definition: structs.h:551
MissileStruct::_misource
int _misource
Definition: structs.h:437
ObjectStruct::_oSolidFlag
BOOL _oSolidFlag
Definition: structs.h:672
ItemStruct::_iPrePower
char _iPrePower
Definition: structs.h:160
QuestStruct::_qidx
unsigned char _qidx
Definition: structs.h:978
ItemStruct::_iVAdd2
int _iVAdd2
Definition: structs.h:164
ObjectStruct::_oAnimLen
int _oAnimLen
Definition: structs.h:666
LightListStruct
Definition: structs.h:1178
PlayerStruct::_pArmorClass
char _pArmorClass
Definition: structs.h:271
PlayerStruct::_py
int _py
Definition: structs.h:191
PlayerStruct::_pILMinDam
int _pILMinDam
Definition: structs.h:335
CopyShort
void CopyShort(const void *src, void *dst)
Definition: loadsave.cpp:227
BFLAG_MISSILE
@ BFLAG_MISSILE
Definition: enums.h:1877
MonsterStruct::_lastx
int _lastx
Definition: structs.h:586
missiles_process_charge
void missiles_process_charge()
Definition: missiles.cpp:4120
MonsterStruct::mMagicRes
unsigned short mMagicRes
Definition: structs.h:605
ObjectStruct::_oAnimCnt
int _oAnimCnt
Definition: structs.h:665
MissileStruct::_miDelFlag
BOOL _miDelFlag
Definition: structs.h:421
PlayerStruct::bReserved
char bReserved[3]
Definition: structs.h:343
ItemStruct::_iPLMana
int _iPLMana
Definition: structs.h:147
ILoad
int ILoad()
Definition: loadsave.cpp:197
ObjectStruct::_oVar8
int _oVar8
Definition: structs.h:687
dPlayer
char dPlayer[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:49
ReturnLvl
int ReturnLvl
Definition: quests.cpp:16
ItemStruct::_iSufPower
char _iSufPower
Definition: structs.h:161
PlayerStruct::_pManaPer
int _pManaPer
Definition: structs.h:265
dFlags
char dFlags[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:56
PlayerStruct::_pwtype
int _pwtype
Definition: structs.h:232
PlayerStruct::_pVar8
int _pVar8
Definition: structs.h:284
MonsterStruct::_mAnimCnt
int _mAnimCnt
Definition: structs.h:565
PlayerStruct::_pBaseVit
int _pBaseVit
Definition: structs.h:252
PlayerStruct::_pBFrames
int _pBFrames
Definition: structs.h:311
SaveLighting
void SaveLighting(int i)
Definition: loadsave.cpp:1495
PlayerStruct::_pILMaxDam
int _pILMaxDam
Definition: structs.h:336
PlayerStruct::_pHPPer
int _pHPPer
Definition: structs.h:260
MonsterStruct::mHit2
unsigned char mHit2
Definition: structs.h:600
MissileStruct::_miAnimType
BYTE _miAnimType
Definition: structs.h:422
NUM_INV_GRID_ELEM
#define NUM_INV_GRID_ELEM
Definition: defs.h:46
ItemStruct::_iMinDex
char _iMinDex
Definition: structs.h:168
LightListStruct::_lid
int _lid
Definition: structs.h:1182
PlayerStruct::_pmode
int _pmode
Definition: structs.h:179
MonsterStruct::_mgoalvar2
int _mgoalvar2
Definition: structs.h:544
PlayerStruct::WorldY
int WorldY
Definition: structs.h:189
MonsterStruct::_my
int _my
Definition: structs.h:549
PlayerStruct::_pWFrames
int _pWFrames
Definition: structs.h:292
MissileStruct::_micaster
int _micaster
Definition: structs.h:438
ObjectStruct::_oRndSeed
int _oRndSeed
Definition: structs.h:679
ItemStruct::_iPLGetHit
int _iPLGetHit
Definition: structs.h:150
ItemStruct::_iPLFR
int _iPLFR
Definition: structs.h:144
PlayerStruct::_pName
char _pName[PLR_NAME_LEN]
Definition: structs.h:237
LightListStruct::_luny
int _luny
Definition: structs.h:1187
PlayerStruct::_pSplFrom
char _pSplFrom
Definition: structs.h:217
ObjectStruct::_oVar6
int _oVar6
Definition: structs.h:685
leveltype
BYTE leveltype
Definition: gendung.cpp:39
QuestStruct::_qtype
unsigned char _qtype
Definition: structs.h:972
PlayerStruct::_pRSplType
char _pRSplType
Definition: structs.h:222
ObjectStruct::_ox
int _ox
Definition: structs.h:659
MAXMONSTERS
#define MAXMONSTERS
Definition: defs.h:31
MonsterStruct::_mVar6
int _mVar6
Definition: structs.h:575
ItemStruct::_iPLStr
int _iPLStr
Definition: structs.h:140
dDead
char dDead[MAXDUNX][MAXDUNY]
Definition: gendung.cpp:21
QuestStruct::_qvar2
unsigned char _qvar2
Definition: structs.h:981
plr
PlayerStruct plr[MAX_PLRS]
Definition: player.cpp:10
PlayerStruct
Definition: structs.h:178
BFLAG_VISIBLE
@ BFLAG_VISIBLE
Definition: enums.h:1878
itemavail
int itemavail[MAXITEMS]
Definition: items.cpp:12
PlayerStruct::_pyvel
int _pyvel
Definition: structs.h:201
tbuff
DEVILUTION_BEGIN_NAMESPACE BYTE * tbuff
Definition: loadsave.cpp:10
ObjectStruct
Definition: structs.h:657
DMAXX
#define DMAXX
Definition: defs.h:7
ItemStruct::_iCreateInfo
WORD _iCreateInfo
Definition: structs.h:101
ObjectStruct::_oy
int _oy
Definition: structs.h:660
MonsterStruct::_menemy
int _menemy
Definition: structs.h:559
PlayerStruct::_pHFrames
int _pHFrames
Definition: structs.h:305
ItemStruct::_iPLLight
int _iPLLight
Definition: structs.h:151
PlayerStruct::_pSplTHotKey
char _pSplTHotKey[4]
Definition: structs.h:231
ItemStruct::_iMaxDam
int _iMaxDam
Definition: structs.h:125
PlayerStruct::_pDexterity
int _pDexterity
Definition: structs.h:249
ItemStruct::_iDelFlag
BOOL _iDelFlag
Definition: structs.h:111