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

Function DeltaLoadLevel

Source/msg.cpp:462–610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462void DeltaLoadLevel()
463{
464 int ii, ot;
465 int i, j, k, l;
466 int x, y, xx, yy;
467 BOOL done;
468
469 if (gbMaxPlayers == 1) {
470 return;
471 }
472
473 deltaload = TRUE;
474 if (currlevel != 0) {
475 for (i = 0; i < nummonsters; i++) {
476 if (sgLevels[currlevel].monster[i]._mx != 0xFF) {
477 M_ClearSquares(i);
478 x = sgLevels[currlevel].monster[i]._mx;
479 y = sgLevels[currlevel].monster[i]._my;
480 monster[i]._mx = x;
481 monster[i]._my = y;
482 monster[i]._moldx = x;
483 monster[i]._moldy = y;
484 monster[i]._mfutx = x;
485 monster[i]._mfuty = y;
486 if (sgLevels[currlevel].monster[i]._mhitpoints != -1)
487 monster[i]._mhitpoints = sgLevels[currlevel].monster[i]._mhitpoints;
488 if (!sgLevels[currlevel].monster[i]._mhitpoints) {
489 monster[i]._moldx = x;
490 monster[i]._moldy = y;
491 M_ClearSquares(i);
492 if (monster[i]._mAi != AI_DIABLO) {
493 if (!monster[i]._uniqtype)
494 /// ASSERT: assert(monster[i].MType != NULL);
495 AddDead(monster[i]._mx, monster[i]._my, monster[i].MType->mdeadval, (direction)monster[i]._mdir);
496 else
497 AddDead(monster[i]._mx, monster[i]._my, monster[i]._udeadval, (direction)monster[i]._mdir);
498 }
499 monster[i]._mDelFlag = TRUE;
500 M_UpdateLeader(i);
501 } else {
502 decode_enemy(i, sgLevels[currlevel].monster[i]._menemy);
503 if (monster[i]._mx && monster[i]._mx != 1 || monster[i]._my)
504 dMonster[monster[i]._mx][monster[i]._my] = i + 1;
505 if (i < MAX_PLRS) {
506 MAI_Golum(i);
507 monster[i]._mFlags |= (MFLAG_TARGETS_MONSTER | MFLAG_GOLEM);
508 } else {
509 M_StartStand(i, monster[i]._mdir);
510 }
511 monster[i]._msquelch = sgLevels[currlevel].monster[i]._mactive;
512 }
513 }
514 }
515 memcpy(automapview, &sgLocals[currlevel], sizeof(automapview));
516 }
517
518 for (i = 0; i < MAXITEMS; i++) {
519 if (sgLevels[currlevel].item[i].bCmd != 0xFF) {

Callers 1

LoadGameLevelFunction · 0.85

Calls 15

M_ClearSquaresFunction · 0.85
AddDeadFunction · 0.85
M_UpdateLeaderFunction · 0.85
decode_enemyFunction · 0.85
MAI_GolumFunction · 0.85
M_StartStandFunction · 0.85
FindGetItemFunction · 0.85
DeleteItemFunction · 0.85
RecreateEarFunction · 0.85
RecreateItemFunction · 0.85
CanPutFunction · 0.85
RespawnItemFunction · 0.85

Tested by

no test coverage detected