Source Code Project Mantis - FSSCP
View Issue Details
0002783FSSCPmultiplayerpublic2013-01-30 02:192013-01-30 02:39
ReporterGoober5000 
Assigned ToGoober5000 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002783: Multiplayer respawn code can't keep its ship classes straight
DescriptionCopied from 0002326...

For some reason, client parse objects already have the correct ship class of the ship they're respawning into. That seems to be causing trouble with change_ship_type, although upon reflection it really shouldn't. Nevertheless, skipping the ship class change seems to fix it. (Strangely, server parse objects retain their parsed ship class as expected.)

EDIT: For posterity, the problem in change_ship_type is most likely due to the parse object's ship_class being assigned to the new class, while its ship_max_hull_strength (and ship_max_shield_strength, and who knows what else) stayed at the original, parsed values.
TagsNo tags attached.
related to 0002326resolved The_E Assert: hull_pct > 0.0f && hull_pct <= 1.0f in ship.cpp line 8298 
Attached Files

Notes
(0014672)
Goober5000   
2013-01-30 02:20   
And thanks to a variable breakpoint, the culprit appears to be line 714 in multiutil.cpp. Guessing this is an old bug from way back when multiplayer was first being developed.

EDIT:
     Net_players[net_player].p_info.p_objp->ship_class = ship_class; // be sure this gets set so respawns work

(0014673)
Goober5000   
2013-01-30 02:32   
Fix committed to trunk@9516.
(0014674)
Goober5000   
2013-01-30 02:39   
For reference, I confirmed this fix by locally reverting the fix for 0002326 and then confirming that the crash no longer occurred.

Issue History
2013-01-30 02:19Goober5000New Issue
2013-01-30 02:19Goober5000Statusnew => assigned
2013-01-30 02:19Goober5000Assigned To => Goober5000
2013-01-30 02:19Goober5000Relationship addedrelated to 0002326
2013-01-30 02:20Goober5000Note Added: 0014672
2013-01-30 02:20Goober5000Note Edited: 0014672bug_revision_view_page.php?bugnote_id=14672#r382
2013-01-30 02:23Goober5000Changeset attached => fs2open trunk r9515
2013-01-30 02:32Goober5000Changeset attached => fs2open trunk r9516
2013-01-30 02:32Goober5000Note Added: 0014673
2013-01-30 02:32Goober5000Statusassigned => resolved
2013-01-30 02:32Goober5000Resolutionopen => fixed
2013-01-30 02:39Goober5000Note Added: 0014674