View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002922 | FSSCP | Pilot data | public | 2013-09-22 01:45 | 2013-09-23 05:28 |
Reporter | Macfie | Assigned To | Goober5000 | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | open | ||
Platform | windows | OS | windows 7 | OS Version | 64bit |
Product Version | 3.7.1 | ||||
Fixed in Version | 3.7.2 | ||||
Summary | 0002922: Medals not being retained in pilot data | ||||
Description | Just noticed a problem with medals. I am playing the FSPort FS1 campaign. The medals display when they are awarded in the debrief and in the medal case but then they disappear from the medal case afterwards. I was awarded three medals but none of them were retained. The data for rank and wings is retained but not medals including the ace awards. | ||||
Steps To Reproduce | The same thing happened with each award. I was awarded the good conduct medal it displayed during the debrief and when I checked the medal case. When I was awarded the distinguished flying cross it displayed but the good conduct medal was gone. When I was awarded the Vasudan medal it was displayed but the other medals were not there. When I went to the barracks there were no medals. | ||||
Additional Information | Problem appears to have started with the r9800 nightly | ||||
Tags | No tags attached. | ||||
|
I've been scrutinizing the code for several hours and this makes no sense. My changes should not have made any difference to the way medals are loaded or saved. I did find a bunch of other bugs in the pilot/stats code, though. |
|
I went back and played with the 3.7.1 AVX build (based off 9786) and the medals work correctly with this build. |
|
Can you try the nightly based off 9796 too? I have been working on this problem all day and, although there is definitely something wrong, it is not willing to show itself. And every part of my code is working perfectly fine. |
|
*Something* is different because the game crashes on exit on 9800 but doesn't on 9798. I have no idea why though. |
|
Copied from the internal: --- Oh good grief. It's not just memset you need to watch out for, it's also memcpy. Turns out that copying one stats structure to another (e.g. [tt]memcpy( &mission->stats, &Player->stats, sizeof(Player->stats) );[/tt] in missioncampaign) means that both stats will share the same underlying data in a SCP_vector, even if they use different vectors. This was the cause of Mantis 0002922 found by Macfie in [url=http://www.hard-light.net/forums/index.php?topic=85624.0]this thread[/url]. So, important lesson for anybody working with SCP_vector or SCP_string: you need to thoroughly check the code for uses of memcpy, not just memset. --- This also explains the crash; it mentioned a heap corruption error but I had no idea how that could be caused. Well, it could be caused by two classes referencing the same heap memory and both trying to clear them. |
|
This is now fixed. |
fs2open: trunk r9813 2013-09-22 20:53 Ported: N/A Details Diff |
use a copy method rather than memcpy to clone stats (Mantis 0002922) |
Affected Issues 0002922 |
|
mod - /trunk/fs2_open/code/fs2netd/fs2netd_client.cpp | Diff File | ||
mod - /trunk/fs2_open/code/mission/missioncampaign.cpp | Diff File | ||
mod - /trunk/fs2_open/code/pilotfile/csg.cpp | Diff File | ||
mod - /trunk/fs2_open/code/pilotfile/plr.cpp | Diff File | ||
mod - /trunk/fs2_open/code/playerman/managepilot.cpp | Diff File | ||
mod - /trunk/fs2_open/code/stats/scoring.cpp | Diff File | ||
mod - /trunk/fs2_open/code/stats/scoring.h | Diff File | ||
mod - /trunk/fs2_open/code/stats/stats.cpp | Diff File | ||
fs2open: trunk r9814 2013-09-23 01:27 Ported: N/A Details Diff |
scoring_level_init is only supposed to initialize a subset of the stats |
Affected Issues 0002922 |
|
mod - /trunk/fs2_open/code/stats/scoring.cpp | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-09-22 01:45 | Macfie | New Issue | |
2013-09-22 01:55 | chief1983 | Assigned To | => Goober5000 |
2013-09-22 01:55 | chief1983 | Status | new => assigned |
2013-09-22 17:34 | Goober5000 | Note Added: 0015282 | |
2013-09-22 18:59 | Macfie | Note Added: 0015283 | |
2013-09-22 19:50 | Goober5000 | Note Added: 0015284 | |
2013-09-22 20:04 | Goober5000 | Note Added: 0015285 | |
2013-09-22 20:04 | Goober5000 | Note Edited: 0015285 | |
2013-09-22 23:36 | Goober5000 | Note Added: 0015286 | |
2013-09-23 00:36 | Goober5000 | Changeset attached | => fs2open trunk r9813 |
2013-09-23 05:11 | Goober5000 | Changeset attached | => fs2open trunk r9814 |
2013-09-23 05:28 | Goober5000 | Note Added: 0015287 | |
2013-09-23 05:28 | Goober5000 | Status | assigned => resolved |
2013-09-23 05:28 | Goober5000 | Fixed in Version | => 3.7.2 |