2018-06-20 06:04 EDT


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0002755FSSCPgameplaypublic2012-12-16 08:53
ReporterSpoon 
Assigned ToValathil 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version3.6.15 
Target VersionFixed in Version 
Summary0002755: #Subsitute takes info from original weapon
DescriptionWhen using #Subsitute, the thruster and sound etc. data is used from the table of the original weapon and not from the weapon that it is being replaced with.
Additional InformationI have a vague feeling a certain wizard knows magic that will fix this.
TagsNo tags attached.
Attached Files
  • patch file icon 2755.patch (2,507 bytes) 2012-12-15 19:50 -
    Index: code/ai/aiturret.cpp
    ===================================================================
    --- code/ai/aiturret.cpp	(revision 9439)
    +++ code/ai/aiturret.cpp	(working copy)
    @@ -1814,6 +1814,7 @@
     
     				objp=&Objects[weapon_objnum];
     				wp=&Weapons[objp->instance];
    +				wip=&Weapon_info[wp->weapon_info_index];
     
     				//nprintf(("AI", "Turret_time_enemy_in_range = %7.3f\n", ss->turret_time_enemy_in_range));		
     				if (weapon_objnum != -1) {
    Index: code/network/multimsgs.cpp
    ===================================================================
    --- code/network/multimsgs.cpp	(revision 9439)
    +++ code/network/multimsgs.cpp	(working copy)
    @@ -3328,6 +3328,8 @@
     	}
     
     	weapon_objnum = weapon_create( &pos, &orient, wid, OBJ_INDEX(objp), -1, 1, 0, 0.0f, ssp);
    +	wid = Weapons[Objects[weapon_objnum].instance].weapon_info_index;
    +
     	if (weapon_objnum != -1) {
     		if ( Weapon_info[wid].launch_snd != -1 ) {
     			snd_play_3d( &Snds[Weapon_info[wid].launch_snd], &pos, &View_position );
    @@ -8384,6 +8386,7 @@
     
     	// create the weapon object	
     	weapon_objnum = weapon_create( &pos, &orient, wid, OBJ_INDEX(objp), -1, 1, 0, 0.0f, ssp);
    +	wid = Weapons[Objects[weapon_objnum].instance].weapon_info_index;
     	if (weapon_objnum != -1) {
     		if ( Weapon_info[wid].launch_snd != -1 ) {
     			snd_play_3d( &Snds[Weapon_info[wid].launch_snd], &pos, &View_position );
    Index: code/ship/ship.cpp
    ===================================================================
    --- code/ship/ship.cpp	(revision 9439)
    +++ code/ship/ship.cpp	(working copy)
    @@ -10295,6 +10295,7 @@
     							// of weapon_create							
     							weapon_objnum = weapon_create( &firing_pos, &firing_orient, weapon, OBJ_INDEX(obj), new_group_id, 
     								0, 0, swp->primary_bank_fof_cooldown[bank_to_fire] );
    +							winfo_p = &Weapon_info[Weapons[Objects[weapon_objnum].instance].weapon_info_index];
     							has_fired = true;
     
     							weapon_set_tracking_info(weapon_objnum, OBJ_INDEX(obj), aip->target_objnum, aip->current_target_is_locked, aip->targeted_subsys);				
    @@ -11030,6 +11031,7 @@
     			// create the weapon -- for multiplayer, the net_signature is assigned inside
     			// of weapon_create
     			weapon_num = weapon_create( &firing_pos, &firing_orient, weapon, OBJ_INDEX(obj), -1, aip->current_target_is_locked);
    +			weapon = Weapons[Objects[weapon_num].instance].weapon_info_index;
     			weapon_set_tracking_info(weapon_num, OBJ_INDEX(obj), aip->target_objnum, aip->current_target_is_locked, aip->targeted_subsys);
     			has_fired = true;
     
    
    patch file icon 2755.patch (2,507 bytes) 2012-12-15 19:50 +

-Relationships
+Relationships

-Notes

~0014482

Valathil (developer)

Problem comes from the substitution happening in weapon_create and the calling functions not updating their weapon_info struct references. Added that to all relevant points in the attached patch. Please review.

~0014483

The_E (administrator)

Approved.

~0014484

Valathil (developer)

Fix committed to trunk@9441.
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2012-12-15 19:47 Spoon New Issue
2012-12-15 19:48 Valathil Assigned To => Valathil
2012-12-15 19:48 Valathil Status new => assigned
2012-12-15 19:50 Valathil File Added: 2755.patch
2012-12-15 19:52 Valathil Note Added: 0014482
2012-12-15 19:52 Valathil Status assigned => code review
2012-12-16 06:26 The_E Note Added: 0014483
2012-12-16 08:53 Valathil Changeset attached => fs2open trunk r9441
2012-12-16 08:53 Valathil Note Added: 0014484
2012-12-16 08:53 Valathil Status code review => resolved
2012-12-16 08:53 Valathil Resolution open => fixed
+Issue History