Source Code Project Mantis - FSSCP
View Issue Details
0003134FSSCPgameplaypublic2014-12-07 15:352015-05-10 08:36
ReporterAxem 
Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.7.1 
Target Version3.7.4Fixed in Version3.7.3 
Summary0003134: dynamic weapon point firing causes a crash when used on a fighter with more than 6 firing points
DescriptionThis is a bit different than the bug that causes a crash with exactly 6 firing points.

MAX_NUM_SLOTS as defined in keycontrol.cpp is just 6, which seems really low considering we can have fighters with a lot more than 6 firing points in a bank. Any more than 6 and the game crashes and will trip an assert in debug.

MageKing suggested to vectorize the table so we don't need arbitrary defines.
TagsNo tags attached.
Attached Filespatch factor_table.patch (6,152) 2015-01-23 19:06
http://scp.indiegames.us/mantis/file_download.php?file_id=2643&type=bug

Notes
(0016414)
MageKing17   
2014-12-07 15:41   
It should also be possible to figure out the size of the largest bank on a ship with dynamic fire linking, and combine that with using vectors, to minimize the memory footprint of the lookup table and avoid having to bump a #define in the future. If anybody else wants to tackle this problem before me, feel free.
(0016460)
LotF   
2015-01-23 19:07   
Added a patch file that should solve this issue.
(0016465)
chief1983   
2015-01-25 19:43   
Thanks! We'll look into this soon.
(0016623)
m_m   
2015-04-08 09:25   
Minor things I noticed:
 - factortable.cpp
  Line 14: The parameter for %d (presumable n) is missing
  Line: 60: isNaturalNumberFactor doesn't need to be a static member of the class. You could use a static function or wrap the definition in an anonymous namespace.
(0016663)
Goober5000   
2015-04-23 23:09   
Tweaking target.
(0016692)
chief1983   
2015-05-04 15:39   
m!m, any chance you'd want to clean this up and put it in a pull request on his behalf? He hasn't responded yet.
(0016693)
m_m   
2015-05-04 15:42   
Yes, I can do that.
(0016698)
chief1983   
2015-05-07 13:57   
https://github.com/scp-fs2open/fs2open.github.com/pull/79
(0016701)
niffiwan   
2015-05-10 07:37   
fixed in aa6936a2a501ebea60366034afbe70a4c5f269ff
(0016702)
niffiwan   
2015-05-10 07:39   
bloody hell, what does it take to have this resolved without being assigned to me?
(0016703)
chief1983   
2015-05-10 08:36   
I gotcha man.

Issue History
2014-12-07 15:35AxemNew Issue
2014-12-07 15:41MageKing17Note Added: 0016414
2014-12-07 15:41MageKing17Assigned To => MageKing17
2014-12-07 15:41MageKing17Statusnew => assigned
2014-12-07 15:41MageKing17Target Version => 3.7.3
2015-01-23 19:06LotFFile Added: factor_table.patch
2015-01-23 19:07LotFNote Added: 0016460
2015-01-23 21:13MageKing17Assigned ToMageKing17 =>
2015-01-23 21:13MageKing17Statusassigned => code review
2015-01-25 19:43chief1983Note Added: 0016465
2015-04-08 09:25m_mNote Added: 0016623
2015-04-23 23:09Goober5000Note Added: 0016663
2015-04-23 23:09Goober5000Target Version3.7.3 => 3.7.4
2015-05-04 15:39chief1983Note Added: 0016692
2015-05-04 15:42m_mNote Added: 0016693
2015-05-07 13:57chief1983Note Added: 0016698
2015-05-10 07:37niffiwanNote Added: 0016701
2015-05-10 07:37niffiwanStatuscode review => resolved
2015-05-10 07:37niffiwanFixed in Version => 3.7.4
2015-05-10 07:37niffiwanResolutionopen => fixed
2015-05-10 07:37niffiwanAssigned To => niffiwan
2015-05-10 07:37niffiwanAssigned Toniffiwan =>
2015-05-10 07:37niffiwanStatusresolved => feedback
2015-05-10 07:37niffiwanResolutionfixed => reopened
2015-05-10 07:38niffiwanStatusfeedback => resolved
2015-05-10 07:38niffiwanResolutionreopened => fixed
2015-05-10 07:38niffiwanAssigned To => niffiwan
2015-05-10 07:38niffiwanStatusresolved => feedback
2015-05-10 07:38niffiwanResolutionfixed => reopened
2015-05-10 07:38niffiwanStatusfeedback => resolved
2015-05-10 07:38niffiwanResolutionreopened => fixed
2015-05-10 07:38niffiwanAssigned Toniffiwan =>
2015-05-10 07:38niffiwanStatusresolved => feedback
2015-05-10 07:38niffiwanResolutionfixed => reopened
2015-05-10 07:39niffiwanNote Added: 0016702
2015-05-10 07:39niffiwanStatusfeedback => resolved
2015-05-10 07:39niffiwanResolutionreopened => fixed
2015-05-10 07:39niffiwanAssigned To => niffiwan
2015-05-10 08:36chief1983Note Added: 0016703
2015-05-10 08:36chief1983Assigned Toniffiwan =>
2015-05-10 08:36chief1983Product Version => 3.7.1
2015-05-10 08:36chief1983Fixed in Version3.7.4 => 3.7.3