View Issue Details

IDProjectCategoryView StatusLast Update
0002781FSSCPPilot datapublic2013-02-03 01:54
Reporterniffiwan Assigned Toniffiwan  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86-64OSLinux MintOS Version13
Product VersionAntipodes 8 
Target Version3.7.0 
Summary0002781: LastPilot/LastPlayer not used consistently
DescriptionIn the "registry", the values for LastPilot/LastPlayer are not used consistently.

$ grep -IRn LastPlayer code
code/menuui/playermenu.cpp:791: last_player = os_config_read_string( NULL, "LastPlayer", NULL);

$ grep -IRn LastPilot code
code/menuui/barracks.cpp:633: os_config_write_string(NULL, "LastPilot", Cur_pilot->callsign);
code/pilotfile/plr.cpp:911: os_config_write_string(NULL, "LastPilot", (char*)callsign);

Therefore this value is never used in FSO, as LastPilot is always written and LastPlayer is always read.

The only question regarding the resolution of this issue is, which value should be used? Trunk uses LastPlayer.
TagsNo tags attached.

Activities

niffiwan

2013-01-28 09:08

developer  

mantis2781-svn.patch (868 bytes)   
Index: code/pilotfile/plr.cpp
===================================================================
--- code/pilotfile/plr.cpp	(revision 9514)
+++ code/pilotfile/plr.cpp	(working copy)
@@ -908,7 +908,7 @@
 	hud_squadmsg_save_keys();
 
 	// set last pilot
-	os_config_write_string(NULL, "LastPilot", (char*)callsign);
+	os_config_write_string(NULL, "LastPlayer", (char*)callsign);
 
 	mprintf(("PLR => Loading complete!\n"));
 
Index: code/menuui/barracks.cpp
===================================================================
--- code/menuui/barracks.cpp	(revision 9514)
+++ code/menuui/barracks.cpp	(working copy)
@@ -630,7 +630,7 @@
 	//write_pilot_file(!is_pilot_multi(Cur_pilot));
 	Pilot.save_player(Cur_pilot);
 
-	os_config_write_string(NULL, "LastPilot", Cur_pilot->callsign);
+	os_config_write_string(NULL, "LastPlayer", Cur_pilot->callsign);
 
 	return 0;
 }
mantis2781-svn.patch (868 bytes)   

niffiwan

2013-01-28 09:09

developer   ~0014665

I checked with Taylor, and the change LastPlayer to LastPilot was not intentional, so here's a patch to revert.

Any comments/feedback?

niffiwan

2013-02-03 01:54

developer   ~0014683

Fix committed to antipodes@9521.

Related Changesets

fs2open: antipodes r9521

2013-02-02 21:31

niffiwan


Ported: N/A

Details Diff
Fix mantis 2781: use LastPlayer consistently in .ini files/registry Affected Issues
0002781
mod - /branches/antipodes/code/menuui/barracks.cpp Diff File
mod - /branches/antipodes/code/pilotfile/plr.cpp Diff File

Issue History

Date Modified Username Field Change
2013-01-28 03:01 niffiwan New Issue
2013-01-28 03:01 niffiwan Status new => assigned
2013-01-28 03:01 niffiwan Assigned To => niffiwan
2013-01-28 09:08 niffiwan File Added: mantis2781-svn.patch
2013-01-28 09:09 niffiwan Note Added: 0014665
2013-01-28 09:09 niffiwan Status assigned => code review
2013-02-03 01:54 niffiwan Changeset attached => fs2open antipodes r9521
2013-02-03 01:54 niffiwan Note Added: 0014683
2013-02-03 01:54 niffiwan Status code review => resolved
2013-02-03 01:54 niffiwan Resolution open => fixed