File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -885,8 +885,14 @@ void red_alert_bash_wingman_status()
885885 mprintf ((" Invalid ship class specified in red alert data for ship %s. Using mission defaults.\n " , shipp->ship_name ));
886886 }
887887
888+ float max_hull;
889+ if (shipp->special_hitpoints )
890+ max_hull = shipp->ship_max_hull_strength ;
891+ else
892+ max_hull = Ship_info[shipp->ship_info_index ].max_hull_strength ;
893+
888894 // restore hull (but not shields)
889- if (ras->hull >= 0 .0f && ras->hull <= ship_objp-> hull_strength )
895+ if (ras->hull >= 0 .0f && ras->hull <= max_hull )
890896 ship_objp->hull_strength = ras->hull ;
891897 else
892898 mprintf ((" Invalid health in red alert data for ship %s. Using mission defaults.\n " , shipp->ship_name ));
@@ -979,9 +985,15 @@ void red_alert_bash_wingman_status()
979985 }
980986 }
981987
988+ float max_hull;
989+ if (pobjp->special_hitpoints )
990+ max_hull = pobjp->ship_max_hull_strength ;
991+ else
992+ max_hull = Ship_info[pobjp->ship_class ].max_hull_strength ;
993+
982994 // restore hull (but not shields)
983- if (ras->hull >= 0 .0f && ras->hull <= (pobjp-> initial_hull * pobjp-> ship_max_hull_strength / 100 . 0f ) )
984- pobjp->initial_hull = (int ) (ras->hull * 100 .0f / pobjp-> ship_max_hull_strength );
995+ if (ras->hull >= 0 .0f && ras->hull <= max_hull )
996+ pobjp->initial_hull = (int ) (ras->hull * 100 .0f / max_hull );
985997 else
986998 mprintf ((" Invalid health in red alert data for ship %s. Using mission defaults.\n " , pobjp->name ));
987999
You can’t perform that action at this time.
0 commit comments