@@ -662,7 +662,7 @@ void do_subobj_heal_stuff(const object* ship_objp, const object* other_obj, cons
662662//
663663// WMC - hull_should_apply armor means that the initial subsystem had no armor, so the hull should apply armor instead.
664664
665- std::pair<std::optional<ConditionData>, float > do_subobj_hit_stuff (object *ship_objp, const object *other_obj, const vec3d *hitpos, int submodel_num, float damage, bool *hull_should_apply_armor, float hit_dot)
665+ std::pair<std::optional<ConditionData>, float > do_subobj_hit_stuff (object *ship_objp, const object *other_obj, const vec3d *hitpos, int submodel_num, float damage, bool *hull_should_apply_armor, float hit_dot, bool shield_hit )
666666{
667667 vec3d g_subobj_pos;
668668 float damage_left, damage_if_hull;
@@ -1003,7 +1003,7 @@ std::pair<std::optional<ConditionData>, float> do_subobj_hit_stuff(object *ship_
10031003 damage_to_apply *= ss_dif_scale;
10041004 }
10051005
1006- if (j == 0 ) {
1006+ if (j == 0 && !shield_hit ) {
10071007 subsys_impact = ConditionData {
10081008 ImpactCondition (subsystem->armor_type_idx ),
10091009 HitType::SUBSYS ,
@@ -2503,8 +2503,10 @@ static void ship_do_damage(object *ship_objp, object *other_obj, const vec3d *hi
25032503 if ( (damage > 0 .0f ) ) {
25042504 bool apply_hull_armor = true ;
25052505
2506+ bool shield_hit = quadrant >= 0 ;
2507+
25062508 // apply damage to subsystems, and get back any remaining damage that needs to go to the hull
2507- auto damage_pair = do_subobj_hit_stuff (ship_objp, other_obj, hitpos, submodel_num, damage, &apply_hull_armor, hit_dot);
2509+ auto damage_pair = do_subobj_hit_stuff (ship_objp, other_obj, hitpos, submodel_num, damage, &apply_hull_armor, hit_dot, shield_hit );
25082510
25092511 damage = damage_pair.second ;
25102512
@@ -2563,13 +2565,15 @@ static void ship_do_damage(object *ship_objp, object *other_obj, const vec3d *hi
25632565 }
25642566 }
25652567
2566- impact_data[static_cast <std::underlying_type_t <HitType>>(HitType::HULL )] = ConditionData {
2567- ImpactCondition (shipp->armor_type_idx ),
2568- HitType::HULL ,
2569- damage,
2570- ship_objp->hull_strength ,
2571- shipp->ship_max_hull_strength ,
2572- };
2568+ if (!shield_hit) {
2569+ impact_data[static_cast <std::underlying_type_t <HitType>>(HitType::HULL )] = ConditionData {
2570+ ImpactCondition (shipp->armor_type_idx ),
2571+ HitType::HULL ,
2572+ damage,
2573+ ship_objp->hull_strength ,
2574+ shipp->ship_max_hull_strength ,
2575+ };
2576+ }
25732577
25742578 // multiplayer clients don't do damage
25752579 if (((Game_mode & GM_MULTIPLAYER ) && MULTIPLAYER_CLIENT )) {
0 commit comments