| 1684 | } |
| 1685 | extern bool IsRestoredGame; |
| 1686 | void 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 | } |
| 1708 | void FreeLevelScript() { |
| 1709 | Osiris_UnloadLevelModule(); |
| 1710 | if (Current_level) { |
no test coverage detected