View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002745 | FSSCP | FRED | public | 2012-12-03 03:42 | 2012-12-23 23:25 |
Reporter | FUBAR-BDHR | Assigned To | Valathil | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.6.15 | ||||
Summary | 0002745: FRED will let you add individual ships in a wing as reinforcement units | ||||
Description | While testing the patch for 0002009 I ran into this one. Not sure what this will do in game but it can't be good to have 1 (or more) ships in a wing as reinforcement units. | ||||
Steps To Reproduce | Open FRED. Drop in a couple of ships, create a wing, go to ship editor, edit 1 of the ships, turn reinforcement flag on. Save mission. Note this can also be done with multiple ships selected like the entire wing. Attaching mission with 1 ship of a wing of 2 as reinforcement unit. | ||||
Tags | No tags attached. | ||||
related to | 0002009 | resolved | CommanderDJ | No warning if reinforcements exceed limit |
|
|
|
Tested in game. This appears to not affect FS2 at all. Wings arrive normally and reinforcements do not appear on list. Only question is should parsing catch this. |
|
2745.patch (1,222 bytes)
Index: mission/missionparse.cpp =================================================================== --- mission/missionparse.cpp (revision 9390) +++ mission/missionparse.cpp (working copy) @@ -2403,8 +2403,19 @@ objp->flags |= OF_PROTECTED; if (parse_flags & P_SF_REINFORCEMENT) - shipp->flags |= SF_REINFORCEMENT; + { + // Individual ships in wings can't be reinforecments - FUBAR + if (shipp->wingnum >= 0) + { + Warning (LOCATION, "Ship %s is a reinforcment unit but is a member of a wing. Ignoring flag.", shipp->ship_name); + } + else + { + shipp->flags |= SF_REINFORCEMENT; + } + } + Assert(!((parse_flags & P_OF_NO_SHIELDS) && (parse_flags2 & P2_OF_FORCE_SHIELDS_ON))); if (parse_flags & P_OF_NO_SHIELDS) objp->flags |= OF_NO_SHIELDS; @@ -4916,7 +4927,16 @@ return; } } else { - instance = rforce_obj->wingnum; + // Individual ships in wings can't be reinforecments - FUBAR + if (rforce_obj->wingnum >= 0) + { + Warning(LOCATION, "Reinforcement %s is part of a wing - Ignoring", ptr->name); + return; + } + else + { + instance = rforce_obj->wingnum; + } } // now, if the reinforcement is a wing, then set the number of waves of the wing == number of |
|
|
|
Attached FS2 side parsing patch and test mission. |
|
Attached patched needs to be looked at and tested. |
|
It's not a patch for the actual issue just a catch game side. |
|
2745_2.patch (1,293 bytes)
Index: code/mission/missionparse.cpp =================================================================== --- code/mission/missionparse.cpp (revision 9452) +++ code/mission/missionparse.cpp (working copy) @@ -2410,8 +2410,18 @@ objp->flags |= OF_PROTECTED; if (parse_flags & P_SF_REINFORCEMENT) - shipp->flags |= SF_REINFORCEMENT; - + { + //Individual ships in wings can't be reinforcements - FUBAR + if(shipp->wingnum >= 0) + { + Warning(LOCATION, "Ship %s is a reinforcement unit but is a member of a wing. Ignoring flag.", shipp->ship_name); + } + else + { + shipp->flags |= SF_REINFORCEMENT; + } + } + if ((parse_flags & P_OF_NO_SHIELDS) && (parse_flags2 & P2_OF_FORCE_SHIELDS_ON)) { Warning(LOCATION, "The parser found a ship with both the \"force-shields-on\" and \"no-shields\" flags; this is inconsistent!"); @@ -4933,7 +4943,16 @@ return; } } else { - instance = rforce_obj->wingnum; + // Individual ships in wings can't be reinforcements - FUBAR + if (rforce_obj->wingnum >= 0) + { + Warning(LOCATION, "Reinforcement %s is part of a wing - Ignoring", ptr->name); + return; + } + else + { + instance = rforce_obj->wingnum; + } } // now, if the reinforcement is a wing, then set the number of waves of the wing == number of |
|
Okay, so what actually needs to be done here? FUBAR's patch did not apply cleanly to latest trunk, so I've uploaded (an equivalent) one that does. I tested it with the mission and it seemed to remedy the issue. So is this enough, if the patch is committed? |
|
I'd like to see a test by mjn to see if normal reinforcement definition gets interfered by the patch. |
|
What needs to happen here is for FRED to prevent this from happening just like the fix for 2009 prevents you from going over the limit. So if you try to make a ship a reinforcement and it's part of a wing you are blocked from doing so. You try to form a wing and one or more of the ships are reinforcements then you are blocked from creating the wing. Of course a check at save never hurts either. My patch is just a FS2 side catch for missions that already have invalid reinforcements. |
|
Ah i see. I'll try to whip something up. |
|
Fix committed to trunk@9462. |
fs2open: trunk r9462 2012-12-23 18:58 Ported: N/A Details Diff |
Fix for Mantis 2745: Make it impossible in FRED to select individual ships for reinforcements when in a wing. From FUBAR: Check at mission parse and spit out warnings. |
Affected Issues 0002745 |
|
mod - /trunk/fs2_open/code/fred2/fredview.cpp | Diff File | ||
mod - /trunk/fs2_open/code/fred2/reinforcementeditordlg.cpp | Diff File | ||
mod - /trunk/fs2_open/code/fred2/shipflagsdlg.cpp | Diff File | ||
mod - /trunk/fs2_open/code/mission/missionparse.cpp | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-12-03 03:42 | FUBAR-BDHR | New Issue | |
2012-12-03 03:44 | FUBAR-BDHR | File Added: 2745.fs2 | |
2012-12-03 03:44 | FUBAR-BDHR | Relationship added | related to 0002009 |
2012-12-03 03:55 | FUBAR-BDHR | Note Added: 0014266 | |
2012-12-03 05:13 | FUBAR-BDHR | File Added: 2745.patch | |
2012-12-03 05:15 | FUBAR-BDHR | File Added: 2745_patchtest.fs2 | |
2012-12-03 05:15 | FUBAR-BDHR | Note Added: 0014267 | |
2012-12-14 06:21 | MjnMixael | Assigned To | => FUBAR-BDHR |
2012-12-14 06:21 | MjnMixael | Status | new => assigned |
2012-12-14 06:22 | MjnMixael | Note Added: 0014446 | |
2012-12-14 06:22 | MjnMixael | Status | assigned => code review |
2012-12-14 07:29 | FUBAR-BDHR | Note Added: 0014449 | |
2012-12-14 07:29 | FUBAR-BDHR | Assigned To | FUBAR-BDHR => |
2012-12-14 07:29 | FUBAR-BDHR | Status | code review => new |
2012-12-18 23:14 | CommanderDJ | Assigned To | => CommanderDJ |
2012-12-18 23:14 | CommanderDJ | Status | new => assigned |
2012-12-18 23:40 | CommanderDJ | File Added: 2745_2.patch | |
2012-12-18 23:41 | CommanderDJ | Note Added: 0014531 | |
2012-12-18 23:42 | CommanderDJ | Note Edited: 0014531 | |
2012-12-22 21:57 | Valathil | Note Added: 0014566 | |
2012-12-22 22:02 | FUBAR-BDHR | Note Added: 0014569 | |
2012-12-22 22:40 | Valathil | Note Added: 0014570 | |
2012-12-23 23:25 | Valathil | Assigned To | CommanderDJ => Valathil |
2012-12-23 23:25 | Valathil | Changeset attached | => fs2open trunk r9462 |
2012-12-23 23:25 | Valathil | Note Added: 0014572 | |
2012-12-23 23:25 | Valathil | Status | assigned => resolved |
2012-12-23 23:25 | Valathil | Resolution | open => fixed |