File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -978,6 +978,7 @@ void ship_hit_music(object *ship_objp, object *other_obj)
978978 Assert (other_obj); // Goober5000
979979
980980 ship* ship_p = &Ships[ship_objp->instance ];
981+ object *parent;
981982
982983 // Switch to battle track when a ship is hit by fire
983984 //
@@ -991,6 +992,9 @@ void ship_hit_music(object *ship_objp, object *other_obj)
991992
992993 attackee_team = Ships[ship_objp->instance ].team ;
993994
995+ // avoid uninitialized value by matching them
996+ attacker_team = attackee_team;
997+
994998 switch ( other_obj->type )
995999 {
9961000 case OBJ_SHIP:
@@ -1004,7 +1008,9 @@ void ship_hit_music(object *ship_objp, object *other_obj)
10041008
10051009 case OBJ_WEAPON:
10061010 // parent of weapon is object num of ship that fired it
1007- attacker_team = Ships[Objects[other_obj->parent ].instance ].team ;
1011+ parent = &Objects[other_obj->parent ];
1012+ if (parent->signature == other_obj->parent_sig )
1013+ attacker_team = Ships[parent->instance ].team ;
10081014 break ;
10091015
10101016 default :
You can’t perform that action at this time.
0 commit comments