View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003093 | FSSCP | scripting | public | 2014-08-14 15:43 | 2014-09-21 14:47 |
Reporter | Parias | Assigned To | m_m | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.7.2 RC1 | ||||
Target Version | 3.7.2 | ||||
Summary | 0003093: mn.getMissionFilenname() doesn't returna value if in GS_STATE_BRIEFING | ||||
Description | For a project I'm working on, I need the ability to get the currently-loaded mission filename while I'm in the GS_STATE_BRIEFING state. However, it looks like by design in lua.cpp, this function will only return a value if GM_IN_MISSION is valid. Here's the function (starting at line 15132): ==== ADE_FUNC(getMissionFilename, l_Mission, NULL, "Gets mission filename", "string", "Mission filename, or empty string if game is not in a mission") { if (!(Game_mode & GM_IN_MISSION)) return ade_set_error(L, "s", ""); return ade_set_args(L, "s", Game_current_mission_filename); } ==== If I comment out the if --> return bit, my script function (which hooks into the start of GS_STATE_BRIEFING) works exactly as expected and correctly returns the currently-loaded mission as soon as I enter the briefing stage. As an alternate option, I tried appending a check for gameseq_get_state(gameseq_get_depth()) == GS_STATE_BRIEFING onto the end of the if statement, but I couldn't seem to get this to work (it would still fail execution and bump a nil value back) so I just left it all commented out for now. Is this check for GM_IN_MISSION needed? I would figure if we're trying to get the current mission filename when we're not in a valid state to do so (i.e. main menu or something) it would just return nil anyways. Am I misunderstanding how this works? | ||||
Tags | No tags attached. | ||||
|
Assigning to m!m to see what he might have to say about this. |
|
I looked through the code and removing the GM_IN_MISSION check should work fine. Game_current_mission_filename should always be a valid string but if no mission is loaded it will be an empty string. |
|
Fix committed to trunk@11077. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-08-14 15:43 | Parias | New Issue | |
2014-09-17 01:52 | Goober5000 | Target Version | => 3.7.2 |
2014-09-17 01:52 | Goober5000 | Note Added: 0016281 | |
2014-09-17 01:52 | Goober5000 | Assigned To | => m_m |
2014-09-17 01:52 | Goober5000 | Status | new => assigned |
2014-09-17 08:48 | m_m | Note Added: 0016285 | |
2014-09-21 14:47 | m_m | Changeset attached | => fs2open trunk r11077 |
2014-09-21 14:47 | m_m | Note Added: 0016287 | |
2014-09-21 14:47 | m_m | Status | assigned => resolved |
2014-09-21 14:47 | m_m | Resolution | open => fixed |