if(game.getOptions().booleanOption("armed_mechwarriors")) {
IGame tmpGame = originalRide.getGame(); if(tmpGame != null && tmpGame.getOptions().booleanOption("armed_mechwarriors")) {
    public MechWarrior(Entity originalRide) {        super();        setCrew(originalRide.getCrew());        setChassis("MechWarrior");        setModel(originalRide.getCrew().getName());        setWeight(1);        // Generate the display name, then add the original ride's name.        StringBuffer newName = new StringBuffer( this.getDisplayName() );        newName.append( " of " )            .append( originalRide.getDisplayName() );        this.displayName = newName.toString();        // Finish initializing this unit.        setOwner(originalRide.getOwner());        initializeInternal(1, Infantry.LOC_INFANTRY);        setOriginalRideId(originalRide.getId());        setOriginalRideExternalId(originalRide.getExternalId());        if(game.getOptions().booleanOption("armed_mechwarriors")) {            try {                addEquipment(EquipmentType.get("InfantryRifle"), Infantry.LOC_INFANTRY);            }             catch(Exception ex) {                ex.printStackTrace();            }        }    }