2018-12-14 03:58 EST


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0002745FSSCPFREDpublic2012-12-23 18:25
ReporterFUBAR-BDHR 
Assigned ToValathil 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version3.6.15 
Target VersionFixed in Version 
Summary0002745: FRED will let you add individual ships in a wing as reinforcement units
DescriptionWhile 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 ReproduceOpen 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.
TagsNo tags attached.
Attached Files
  • ? file icon 2745.fs2 (4,416 bytes) 2012-12-02 22:44
  • patch file icon 2745.patch (1,222 bytes) 2012-12-03 00:13 -
    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
    
    patch file icon 2745.patch (1,222 bytes) 2012-12-03 00:13 +
  • ? file icon 2745_patchtest.fs2 (12,607 bytes) 2012-12-03 00:15
  • patch file icon 2745_2.patch (1,293 bytes) 2012-12-18 18:40 -
    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
    
    patch file icon 2745_2.patch (1,293 bytes) 2012-12-18 18:40 +

-Relationships
related to 0002009resolvedCommanderDJ No warning if reinforcements exceed limit 
+Relationships

-Notes

~0014266

FUBAR-BDHR (developer)

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.

~0014267

FUBAR-BDHR (developer)

Attached FS2 side parsing patch and test mission.

~0014446

MjnMixael (manager)

Attached patched needs to be looked at and tested.

~0014449

FUBAR-BDHR (developer)

It's not a patch for the actual issue just a catch game side.

~0014531

CommanderDJ (developer)

Last edited: 2012-12-18 18:42

View 2 revisions

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?

~0014566

Valathil (developer)

I'd like to see a test by mjn to see if normal reinforcement definition gets interfered by the patch.

~0014569

FUBAR-BDHR (developer)

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.

~0014570

Valathil (developer)

Ah i see. I'll try to whip something up.

~0014572

Valathil (developer)

Fix committed to trunk@9462.
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2012-12-02 22:42 FUBAR-BDHR New Issue
2012-12-02 22:44 FUBAR-BDHR File Added: 2745.fs2
2012-12-02 22:44 FUBAR-BDHR Relationship added related to 0002009
2012-12-02 22:55 FUBAR-BDHR Note Added: 0014266
2012-12-03 00:13 FUBAR-BDHR File Added: 2745.patch
2012-12-03 00:15 FUBAR-BDHR File Added: 2745_patchtest.fs2
2012-12-03 00:15 FUBAR-BDHR Note Added: 0014267
2012-12-14 01:21 MjnMixael Assigned To => FUBAR-BDHR
2012-12-14 01:21 MjnMixael Status new => assigned
2012-12-14 01:22 MjnMixael Note Added: 0014446
2012-12-14 01:22 MjnMixael Status assigned => code review
2012-12-14 02:29 FUBAR-BDHR Note Added: 0014449
2012-12-14 02:29 FUBAR-BDHR Assigned To FUBAR-BDHR =>
2012-12-14 02:29 FUBAR-BDHR Status code review => new
2012-12-18 18:14 CommanderDJ Assigned To => CommanderDJ
2012-12-18 18:14 CommanderDJ Status new => assigned
2012-12-18 18:40 CommanderDJ File Added: 2745_2.patch
2012-12-18 18:41 CommanderDJ Note Added: 0014531
2012-12-18 18:42 CommanderDJ Note Edited: 0014531 View Revisions
2012-12-22 16:57 Valathil Note Added: 0014566
2012-12-22 17:02 FUBAR-BDHR Note Added: 0014569
2012-12-22 17:40 Valathil Note Added: 0014570
2012-12-23 18:25 Valathil Assigned To CommanderDJ => Valathil
2012-12-23 18:25 Valathil Changeset attached => fs2open trunk r9462
2012-12-23 18:25 Valathil Note Added: 0014572
2012-12-23 18:25 Valathil Status assigned => resolved
2012-12-23 18:25 Valathil Resolution open => fixed
+Issue History