if (Server.entityVerifier == null) {
Server.entityVerifier = new EntityVerifier(new File(VERIFIER_CONFIG_FILENAME));
}
// we can only test meks and vehicles right now
if ((entity instanceof Mech) || (entity instanceof Tank)) {
TestEntity testEntity = null;
entity.restore();
if (entity instanceof Mech) {
testEntity = new TestMech((Mech) entity, Server.entityVerifier.mechOption, null);
}
if (entity instanceof VTOL) {
testEntity = new TestTank((Tank) entity, Server.entityVerifier.tankOption, null);// not
}
// implemented
// yet.
if (entity instanceof Tank) {
testEntity = new TestTank((Tank) entity, Server.entityVerifier.tankOption, null);
}
StringBuffer sb = new StringBuffer();
if (testEntity.correctEntity(sb, !game.getOptions().booleanOption("is_eq_limits"))) {
entity.setDesignValid(true);
} else {
System.err.println(sb);
if (game.getOptions().booleanOption("allow_illegal_units")) {
entity.setDesignValid(false);