View Issue Details

IDProjectCategoryView StatusLast Update
0002929FSSCPuser interfacepublic2014-06-14 10:43
Reporterniffiwan Assigned Toniffiwan  
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.7.1 
Summary0002929: pilot rank icons in barracks do not switch correctly between single & multi
Descriptionsee summary
Steps To Reproduceenter the barracks
find a pilot with a different rank between single & multi player
select the problem pilot
switch between single & multiplayer
notice that while the rank icon is OK when you initially enter the barracks, after the 1st switch the icons become switched

i.e. if single has 2 pips and multi has 1, after switching it'll display 2 for multi & 1 for single
Additional InformationI should attempt to recreate this problem with a fresh pilot (once 2906 is fixed of course!)
TagsNo tags attached.

Activities

niffiwan

2013-10-14 02:41

developer   ~0015328

mantis ate my post :|

In summary:
1) The rank data is read from all pilot PLR files in pilotfile::verify (called from barracks_pilot_filter() used in as filter in cf_get_file_list_preallocated)
2) This rank data is only updated when PLR's are saved
3) during a single/multi switch only the current pilot is load/saved at the end of the switch, meaning outdated rank data being read for the rank pips
4) the rest of the pilots are not load/saved when switching between single/multi in the barracks
5) 2 cases to be fixed; clicking the single/multi buttons, and pressing the TAB key

I think the solution is to change pilotfile::verify to read the real rank from the pilot, either multi_stats (PLR) or p->stats (CSG). Since non-selected pilots displayed in the barracks are not required to have a valid campaign in the current mod, a fallback will be needed for the single-player campaign rank.

niffiwan

2014-05-26 21:07

developer   ~0015766

OR! Both the multi rank and the "current" single rank could be saved in the PLR flags section that is read by pilotfile::verify. I like that solution a lot more than reading more data from the pilotfiles.

niffiwan

2014-05-29 09:12

developer   ~0015771

This has got to have been one of the most finicky and annoying trivialities I've run across!

Patch ready for review here:
https://github.com/scp-fs2open/fs2open.github.com/pull/32

If you're testing, you'll need to ensure your pilots CSG are saved in the correct format before you can see the bug being fixed correctly.

Echelon9

2014-06-14 07:31

developer   ~0015862

Have commented on the Github issue.

niffiwan

2014-06-14 10:43

developer   ~0015869

Fix committed to trunk@10818.

Related Changesets

fs2open: trunk r10818

2014-06-14 07:02

niffiwan


Ported: N/A

Details Diff
Fix mantis 2929

Save shortcut rank to the csg flags & bump csg version
Add function to read the csg rank during pilotfile::verify()
Reorder 'find pilots' call so that Game_mode is valid for verify
Affected Issues
0002929
mod - /trunk/fs2_open/code/menuui/barracks.cpp Diff File
mod - /trunk/fs2_open/code/pilotfile/csg.cpp Diff File
mod - /trunk/fs2_open/code/pilotfile/csg_convert.cpp Diff File
mod - /trunk/fs2_open/code/pilotfile/pilotfile.h Diff File
mod - /trunk/fs2_open/code/pilotfile/plr.cpp Diff File

Issue History

Date Modified Username Field Change
2013-09-30 01:26 niffiwan New Issue
2013-10-14 01:29 niffiwan Assigned To => niffiwan
2013-10-14 01:29 niffiwan Status new => assigned
2013-10-14 02:41 niffiwan Note Added: 0015328
2014-05-26 21:07 niffiwan Note Added: 0015766
2014-05-29 09:12 niffiwan Note Added: 0015771
2014-05-29 09:12 niffiwan Status assigned => code review
2014-06-14 07:31 Echelon9 Note Added: 0015862
2014-06-14 10:43 niffiwan Changeset attached => fs2open trunk r10818
2014-06-14 10:43 niffiwan Note Added: 0015869
2014-06-14 10:43 niffiwan Status code review => resolved
2014-06-14 10:43 niffiwan Resolution open => fixed