MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / LGSMission

Function LGSMission

Descent3/loadstate.cpp:506–537  ·  view source on GitHub ↗

loads in level's mission and level.

Source from the content-addressed store, hash-verified

504
505// loads in level's mission and level.
506int LGSMission(const char *msnname, int level) {
507 // we will free the mission.
508 // Free any game objects/etc that needs to be done when ending a level here.
509 FreeScriptsForLevel();
510
511 Osiris_DisableCreateEvents();
512 if (LoadMission((const char *)msnname)) {
513 SetCurrentLevel(level);
514 Player_num = 0; // Reset player num
515 Players[Player_num].ship_index = FindShipName(DEFAULT_SHIP);
516 ASSERT(Players[Player_num].ship_index != -1);
517
518 // Load any addon data
519 mng_LoadAddonPages();
520
521 InitPlayerNewShip(Player_num, INVRESET_ALL);
522 InitCameraViews(1); // Turn off all camera views, including rear views
523
524 if (!LoadAndStartCurrentLevel()) {
525 Int3();
526 Osiris_EnableCreateEvents();
527 return LGS_STARTLVLFAILED;
528 }
529 } else {
530 Int3();
531 Osiris_EnableCreateEvents();
532 return LGS_MISSIONFAILED;
533 }
534 Osiris_EnableCreateEvents();
535 // mng_LoadAddonPages ();
536 return LGS_OK;
537}
538
539extern uint8_t AutomapVisMap[MAX_ROOMS];
540

Callers 1

LoadGameStateFunction · 0.85

Calls 10

FreeScriptsForLevelFunction · 0.85
LoadMissionFunction · 0.85
SetCurrentLevelFunction · 0.85
FindShipNameFunction · 0.85
mng_LoadAddonPagesFunction · 0.85
InitPlayerNewShipFunction · 0.85
InitCameraViewsFunction · 0.85
LoadAndStartCurrentLevelFunction · 0.85

Tested by

no test coverage detected