2019-10-16 11:59 EDT


View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001731FSSCPFREDpublic2008-08-03 07:53
ReporterRansom Arceihn 
Assigned Tokarajorma 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
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

-Relationships
+Relationships

-Notes

~0009526

karajorma (administrator)

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.

~0009531

karajorma (administrator)

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.
+Notes

-Issue History
Date Modified Username Field Change
2008-07-22 01:30 Ransom Arceihn New Issue
2008-07-22 01:30 Ransom Arceihn File Added: specialhitstest.fs2
2008-07-22 01:32 Goober5000 Status new => assigned
2008-07-22 01:32 Goober5000 Assigned To => Goober5000
2008-08-02 16:06 karajorma Note Added: 0009526
2008-08-02 17:27 karajorma Assigned To Goober5000 => karajorma
2008-08-03 07:53 karajorma Status assigned => resolved
2008-08-03 07:53 karajorma Fixed in Version => 3.6.10
2008-08-03 07:53 karajorma Resolution open => fixed
2008-08-03 07:53 karajorma Note Added: 0009531
+Issue History