do

local CBFP_oldXRB0204 = XRB0204

XRB0204 = Class(CBFP_oldXRB0204) {

    # Added by Brute51 - this prevents a weird engine related bug. I tried putting it in Cybranunits.lua but that
    # crashes the game for some reason. [167]

    OnStartBuild = function(self, unitBeingBuilt, order)
        local myArmy = self:GetAIBrain():GetArmyIndex()
        local otherArmy = unitBeingBuilt:GetAIBrain():GetArmyIndex()
        if order != 'Repair' or (IsAlly( myArmy, otherArmy) and not ArmyIsCivilian( otherArmy)) then
            CBFP_oldXRB0204.OnStartBuild(self, unitBeingBuilt, order)
        else
            IssueStop( {self} )
            IssueClearCommands( {self} )
        end
    end,

}
TypeClass = XRB0204

end