MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / InitLevelChange

Function InitLevelChange

Source/player.cpp:397–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397void InitLevelChange(Player &player)
398{
399 Player &myPlayer = *MyPlayer;
400
401 RemovePlrMissiles(player);
402 player.pManaShield = false;
403 player.wReflections = 0;
404 if (&player != MyPlayer) {
405 // share info about your manashield when another player joins the level
406 if (myPlayer.pManaShield)
407 NetSendCmd(true, CMD_SETSHIELD);
408 // share info about your reflect charges when another player joins the level
409 NetSendCmdParam1(true, CMD_SETREFLECT, myPlayer.wReflections);
410 } else if (qtextflag) {
411 qtextflag = false;
412 stream_stop();
413 }
414
415 FixPlrWalkTags(player);
416 SetPlayerOld(player);
417 if (&player == MyPlayer) {
418 dPlayer[player.position.tile.x][player.position.tile.y] = player.getId() + 1;
419 } else {
420 player._pLvlVisited[player.plrlevel] = true;
421 }
422
423 ClrPlrPath(player);
424 player.destAction = ACTION_NONE;
425 player._pLvlChanging = true;
426
427 if (&player == MyPlayer) {
428 player.pLvlLoad = 10;
429 }
430}
431
432/**
433 * @brief Continue movement towards new tile

Callers 3

StartNewLvlFunction · 0.85
RestartTownLvlFunction · 0.85
StartWarpLvlFunction · 0.85

Calls 8

RemovePlrMissilesFunction · 0.85
NetSendCmdFunction · 0.85
NetSendCmdParam1Function · 0.85
FixPlrWalkTagsFunction · 0.85
SetPlayerOldFunction · 0.85
ClrPlrPathFunction · 0.85
stream_stopFunction · 0.70
getIdMethod · 0.65

Tested by

no test coverage detected