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

Function InitLevelScript

Descent3/Mission.cpp:1686–1707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685extern bool IsRestoredGame;
1686void InitLevelScript() {
1687 if (Current_level->filename) {
1688 char filename[_MAX_PATH], ext[_MAX_EXT];
1689 ddio_SplitPath(Current_level->filename, NULL, filename, ext);
1690#if defined(WIN32)
1691 strcat(filename, ".dll");
1692#elif defined(MACOSX)
1693 strcat(filename, ".dylib");
1694#elif defined(__LINUX__)
1695 strcat(filename, ".so");
1696#else
1697 #error Unsupported platform!
1698#endif
1699 Osiris_LoadLevelModule(filename);
1700 }
1701 //@$-D3XExecScript(Current_level->d3xthread, Current_mission.cur_level, REF_LEVELTYPE, EVT_LEVELSTART, 0, 0);
1702 tOSIRISEventInfo ei;
1703 // This is a hack... we don't want the level start script to be called when restoring a save game
1704 if (!IsRestoredGame)
1705 Osiris_CallLevelEvent(EVT_LEVELSTART, &ei);
1706 AssignScriptsForLevel(); // initialize all scripts for level.
1707}
1708void FreeLevelScript() {
1709 Osiris_UnloadLevelModule();
1710 if (Current_level) {

Callers 1

StartLevelFunction · 0.85

Calls 4

Osiris_LoadLevelModuleFunction · 0.85
Osiris_CallLevelEventFunction · 0.85
AssignScriptsForLevelFunction · 0.85
ddio_SplitPathFunction · 0.50

Tested by

no test coverage detected