Source Code Project Mantis - FSSCP
View Issue Details
0001731FSSCPFREDpublic2008-07-22 01:302008-08-03 07:53
ReporterRansom Arceihn 
Assigned Tokarajorma 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.6.10 
Summary0001731: when-argument and Special Hits not behaving together
DescriptionThis is an awfully specific bug. Using when-argument to refer to the hits-left (or shields-left) of a wing of ships will not work correctly if the ships in question have special hitpoints set.

Using the regular when conditional and 'or' works fine, however, and using an identical when-argument event on a set of ships who do not have special hitpoints also works without a hitch.

Test mission attached.
TagsNo tags attached.
Attached Files? specialhitstest.fs2 (11,588) 2008-07-22 01:30

2008-08-02 16:06   
I know what's causing this one actually. Hits_Left calls CTEXT() to get the name of the ship. CTEXT then looks at what is there, finds the name of the ship and then moves on. But before returning it it thinks "What if this is a variable!" So it checks to see if there is a variable with that name and if so returns the value that variable holds instead. And of course when you make a Special Hits value for a ship it's added as a variable with the name of the ship. So the value of that variable is returned instead of the name.

Hits-left obviously can't find the ship so the SEXP never triggers. I'm not entirely sure how to solve this problem to be honest. Having a variable named after a ship and visa versa is perfectly legal. I suppose we could add a warning about it in the future.
2008-08-03 07:53   
I fixed the immediate problem but this can also occur with user-defined variables and we're going to need to do something about them too.

Issue History
2008-07-22 01:30Ransom ArceihnNew Issue
2008-07-22 01:30Ransom ArceihnFile Added: specialhitstest.fs2
2008-07-22 01:32Goober5000Statusnew => assigned
2008-07-22 01:32Goober5000Assigned To => Goober5000
2008-08-02 16:06karajormaNote Added: 0009526
2008-08-02 17:27karajormaAssigned ToGoober5000 => karajorma
2008-08-03 07:53karajormaStatusassigned => resolved
2008-08-03 07:53karajormaFixed in Version => 3.6.10
2008-08-03 07:53karajormaResolutionopen => fixed
2008-08-03 07:53karajormaNote Added: 0009531