////////////////////////////////////////////////////////////////////////// Script Management for Missions and Levels ////////////////////////////////////////////////////////////////////////// Initializes a mission's default script
| 1659 | /////////////////////////////////////////////////////////////////////////////// |
| 1660 | // Initializes a mission's default script |
| 1661 | bool InitMissionScript() { |
| 1662 | // need to do this so when UI runs, it has a background. |
| 1663 | // SetUICallback(DEFAULT_UICALLBACK); |
| 1664 | // if there is no default script, we will load a null script, which means that whatever object |
| 1665 | // uses scripts, will not do anything. |
| 1666 | //@@ fp = cfopen(DEFAULT_SCROBJ_NAME, "rb"); |
| 1667 | //@@ if (!fp) { |
| 1668 | //@@ DoMessageBox("Error", "Unable to find mission script.", MSGBOX_OK, UICOL_WINDOW_TITLE, |
| 1669 | // UICOL_TEXT_NORMAL); |
| 1670 | //@@ mprintf(0, "Unable to open default script. Loading null script...\n"); |
| 1671 | //@@ return false; |
| 1672 | //@@ } |
| 1673 | //@@ else { |
| 1674 | //@@ Current_mission.d3xmod = D3XLoadProgram(fp); |
| 1675 | //@@ if (!Current_mission.d3xmod) { |
| 1676 | //@@ DoMessageBox("Error", "Unable to find mission script.", MSGBOX_OK, UICOL_WINDOW_TITLE, |
| 1677 | // UICOL_TEXT_NORMAL); |
| 1678 | //@@ mprintf(0, "Unable to open default script. Loading null script...\n"); |
| 1679 | //@@ return false; |
| 1680 | //@@ } |
| 1681 | //@@ cfclose(fp); |
| 1682 | //@@ } |
| 1683 | return true; |
| 1684 | } |
| 1685 | extern bool IsRestoredGame; |
| 1686 | void InitLevelScript() { |
| 1687 | if (Current_level->filename) { |
no outgoing calls
no test coverage detected