Source Code Project Mantis - FSSCP
View Issue Details
0001196FSSCPuser interfacepublic2007-01-04 16:312012-01-09 13:06
ReporterTahna Los 
Assigned Totaylor 
PlatformOSOS Version
Product Version3.6.9 
Target VersionFixed in Version3.6.9 
Summary0001196: CTD when selecting greyed out Maxim gun
DescriptionReproduced in Derelict Mission: "The Horror in the Deep"

- Go to the Ship Selection Screen. You should be in a Myrmidon.
- Now go to the Weapon Loadout Screen
- Select the Maxim gun (it is greyed out, and therefore inaccessible to the Myrmidon)
- game pauses and crashes at this point.
TagsNo tags attached.
has duplicate 0001240resolved taylor Targeting Laser 
Attached Files

2007-01-04 18:30   
I've tested and confirmed it.

But the "ghost" weapon is "UD-D Kayser". I've opened the mission in FRED and in Team Loadout Editor UD-D Kayser is not selected. So, how the hell does it appear in the game?

If you assign any amount of UD-D Kayser, then there's no problem. The gun is grayed out, but you can click on it.
2007-01-04 19:54   
It's crashing because of a NULL pointer issue, there is no description for the weapon. The problem is that the mission is using the Targeting Laser instead of a Kayser. But I'm not sure if that is a mistake or what. The reason that it has the Kayser icon though, is because it actually has the Kayser icon, it's in the retail tbl that way.

So while technically this is a mission bug, it does point out something that we need to address in the code so that it doesn't crash when something like this happens. It also pointed out a memory leak that I've just fixed.
Tahna Los   
2007-01-04 23:21   

Thanks for looking into it. I was thinking that it was either a maxim or a kayser gun since the icons look very similar..... But was thinking that since the player should not have access to the kayser gun at this point of the game, but maxim gun? Well it was a possibility. Besides, the Myrmidon is NOT supposed to be compatible with the Maxim, and it is compatible with the Kayser.....

But yes, thanks for looking into this.
2007-01-05 00:02   
Problem fixed locally. I'll resolve this once the code hits CVS.
2007-01-05 07:16   
@Tanha Los:

Be careful about EXACT names all over FS2 tables.

I've said "UD-D kaiser" not "UD-8 Kaiser". Myrmidon is compatible with UD-8 but not with UD-D.



Maybe there's another bug in FRED. In team loadout window, I can assure you that there's neither Targeting Laser nor TAG-C missile. But they appear in the FS2 file and you CAN'T fix it through FRED. They both appear in Weapon Loadout window ingame.

Is this supposed to happen?
2007-01-05 08:01   
@ARSPR: Nope, it shouldn't do that. I'll look into it before I start all of my commits later today.
2007-01-05 11:22   
(Last edited: 2007-01-05 11:23)
Ok, think I found the basic problem. When the mission is loaded it will take anything in the weapon pool, regardless of what it is, so long as it's a weapon. FRED also takes this, but it filters out weapons in the list which aren't "player allowed". It still keeps the count however, and will add those weapons to the list that is saved in the mission file.

So I think that there are two issues here: 1) FRED needs to reset the weapon count for anything in the weapon pool which isn't allowed for the player, and 2) when the mission is parsed, it needs to do something similar to prevent strange issues for users.

#-1 is easy, and I added a warning popup so that it knows this was fixed automatically, and you just needs to re-save the mission.

#-2 will only happen when not in FRED, and will be silently fixed, except for a message in the debug log.

Since non-player-allowed weapons may not have a proper setup to actually be used on the interface in the first place, I think it's safer to just filter them out automatically than to let them stay and see what happens. I'm not sure if anyone is actually trying to make use of this bug for their mod/mission, but it's something that they can get around if needed (just make the weapon player usable).

2007-01-05 23:09   
Please double-check that it's working ok with this build:
2007-01-07 08:16   

Issue History
2007-01-04 16:31Tahna LosNew Issue
2007-01-04 18:30ARSPRNote Added: 0007385
2007-01-04 19:54taylorNote Added: 0007386
2007-01-04 19:54taylorStatusnew => assigned
2007-01-04 19:54taylorAssigned To => taylor
2007-01-04 23:21Tahna LosNote Added: 0007387
2007-01-05 00:02taylorNote Added: 0007388
2007-01-05 07:16ARSPRNote Added: 0007393
2007-01-05 08:01taylorNote Added: 0007394
2007-01-05 11:22taylorNote Added: 0007395
2007-01-05 11:23taylorNote Edited: 0007395
2007-01-05 23:09taylorNote Added: 0007398
2007-01-07 08:16taylorStatusassigned => resolved
2007-01-07 08:16taylorFixed in Version => 3.6.9
2007-01-07 08:16taylorResolutionopen => fixed
2007-01-07 08:16taylorNote Added: 0007416
2007-03-23 16:35taylorRelationship addedhas duplicate 0001240
2012-01-05 17:55taylorChangeset attached => Import 2012-01-05 17:52:05 fs2_open_3_6_9 r3846
2012-01-05 17:55taylorChangeset attached => Import 2012-01-05 17:52:05 trunk r3868
2012-01-09 13:06taylorChangeset attached => fs2open_websvn fs2_open_3_6_9 r3846
2012-01-09 13:06taylorChangeset attached => fs2open_websvn trunk r3868