I found the problem.
First, I did rearrange the three hit boxes so as to have no overlap. But that didn't help.
Then I got to looking more broadly at the hitBone method in the plane class. This popped out in the code...
The first condition
if(s.startsWith("xx"))
{
neglects any following conditions such as
if(s.startsWith("xxarmor"))
because of the closing
return;
}
thus exiting this test condition before being able to assess any of those many other following test conditions where the string does start with "xx". It exits out early all the time if a hit box starts with ''xx", missing the many others below the "xxarmor" and "xxeng" ones. If, say, my new "xxtank2" is hit, the method sees and does nothing because it limits to only "xxarmor" and "xxeng", exiting hitBone and thus making for far stronger plane (devoid of other damage smokes/fires.)
protected void hitBone(String s, Shot shot, Point3d point3d)
{
if(s.startsWith("xx"))
{
if(s.startsWith("xxarmor"))
{
if(s.endsWith("p1"))
getEnergyPastArmor(8.26F / (Math.abs((float)((Tuple3d) (Aircraft.v1)).x) + 1E-005F), shot);
return;
}
if(s.startsWith("xxeng"))
{
int i = s.charAt(5) - 49;
if(s.endsWith("case"))
{
if(getEnergyPastArmor(1.7F, shot) > 0.0F)
{
if(World.Rnd().nextFloat(20000F, 140000F) < shot.power)
((FlightModelMain) (super.FM)).AS.setEngineStuck(shot.initiator, i);
if(World.Rnd().nextFloat(10000F, 50000F) < shot.power)
((FlightModelMain) (super.FM)).AS.hitEngine(shot.initiator, i, 2);
} else
if(World.Rnd().nextFloat() < 0.04F)
((FlightModelMain) (super.FM)).EI.engines[i].setCyliderKnockOut(shot.initiator, 1);
else
((FlightModelMain) (super.FM)).EI.engines[i].setReadyness(shot.initiator, ((FlightModelMain) (super.FM)).EI.engines[i].getReadyness() - 0.02F);
getEnergyPastArmor(12F, shot);
}
if(s.endsWith("cyls"))
{
if(getEnergyPastArmor(0.85F, shot) > 0.0F && World.Rnd().nextFloat() < ((FlightModelMain) (super.FM)).EI.engines[i].getCylindersRatio() * 0.9878F)
{
((FlightModelMain) (super.FM)).EI.engines[i].setCyliderKnockOut(shot.initiator, World.Rnd().nextInt(1, (int)(shot.power / 19000F)));
if(World.Rnd().nextFloat() < shot.power / 48000F)
((FlightModelMain) (super.FM)).AS.hitEngine(shot.initiator, 0, 2);
}
getEnergyPastArmor(25F, shot);
}
if(s.endsWith("supc"))
{
if(getEnergyPastArmor(0.05F, shot) > 0.0F)
((FlightModelMain) (super.FM)).EI.engines[i].setKillCompressor(shot.initiator);
getEnergyPastArmor(2.0F, shot);
}
if(s.endsWith("oil1") && World.Rnd().nextFloat() < 0.5F && getEnergyPastArmor(0.25F, shot) > 0.0F)
((FlightModelMain) (super.FM)).AS.hitOil(shot.initiator, 0);
}
return;
} // <----------------------------------THIS IS THE BAD PLAYER -- NEEDS TO FOLLOW ALL startsWith("xx*")----------------------------
if(s.startsWith("xxmgun"))
{
and so on...
This is proper...
protected void hitBone(String s, Shot shot, Point3d point3d)
{
if(s.startsWith("xx"))
{
if(s.startsWith("xxarmor"))
{
if(s.endsWith("p1"))
getEnergyPastArmor(8.26F / (Math.abs((float)((Tuple3d) (Aircraft.v1)).x) + 1E-005F), shot);
return;
}
if(s.startsWith("xxeng"))
{
int i = s.charAt(5) - 49;
if(s.endsWith("case"))
{
if(getEnergyPastArmor(1.7F, shot) > 0.0F)
{
if(World.Rnd().nextFloat(20000F, 140000F) < shot.power)
((FlightModelMain) (super.FM)).AS.setEngineStuck(shot.initiator, i);
if(World.Rnd().nextFloat(10000F, 50000F) < shot.power)
((FlightModelMain) (super.FM)).AS.hitEngine(shot.initiator, i, 2);
} else
if(World.Rnd().nextFloat() < 0.04F)
((FlightModelMain) (super.FM)).EI.engines[i].setCyliderKnockOut(shot.initiator, 1);
else
((FlightModelMain) (super.FM)).EI.engines[i].setReadyness(shot.initiator, ((FlightModelMain) (super.FM)).EI.engines[i].getReadyness() - 0.02F);
getEnergyPastArmor(12F, shot);
}
if(s.endsWith("cyls"))
{
if(getEnergyPastArmor(0.85F, shot) > 0.0F && World.Rnd().nextFloat() < ((FlightModelMain) (super.FM)).EI.engines[i].getCylindersRatio() * 0.9878F)
{
((FlightModelMain) (super.FM)).EI.engines[i].setCyliderKnockOut(shot.initiator, World.Rnd().nextInt(1, (int)(shot.power / 19000F)));
if(World.Rnd().nextFloat() < shot.power / 48000F)
((FlightModelMain) (super.FM)).AS.hitEngine(shot.initiator, 0, 2);
}
getEnergyPastArmor(25F, shot);
}
if(s.endsWith("supc"))
{
if(getEnergyPastArmor(0.05F, shot) > 0.0F)
((FlightModelMain) (super.FM)).EI.engines[i].setKillCompressor(shot.initiator);
getEnergyPastArmor(2.0F, shot);
}
if(s.endsWith("oil1") && World.Rnd().nextFloat() < 0.5F && getEnergyPastArmor(0.25F, shot) > 0.0F)
((FlightModelMain) (super.FM)).AS.hitOil(shot.initiator, 0);
return;
// } <----------------------------------MOVED TO END OF ALL startsWith("xx*")----------------------------
if(s.startsWith("xxmgun"))
{
and so on.....