How to prevent the game ending when no carrier/Mothership remain?

For reference, I’m running the game unpacked and have been having fun pitting edited starting fleets against each other, but whenever a team (including the player) spawn without a carrier or mothership, the game terminates them after exactly 16 seconds. I’ve tried editing Data\scripts\gamerules\killmothership.lua and removing the lines:
Player_HasShipWithBuildQueue(playerIndex)==0) then
– kill this player

and I’ve also tried changing the preceding localgameOver = 1, to 0, and I figured that should do it but nothing has worked yet. Is there somewhere else I should be looking to make this fix?

The function mainrule_updating() in the file …/leveldata/multiplayer/lib/main.lua is what should be handling the end game rules in the default multiplayer games.

If you want the game to ‘‘never’’ end, a super quick change is to add return right before the local playerIndex = 0

function mainrule_updating()
  if mainrule_flag == 1 then
    objectivePrimary = Objective_Add("$3005", OT_Primary)
    Objective_AddDescription(objectivePrimary, "$3006")
    Subtitle_Message_Handler("$3007", 2, "data:sound\\speech\\allships\\emperor\\CHALLENGE_DESTROYMOTHERSHIPS_2", Universe_CurrentPlayer())
    mainrule_flag = 0
  local playerIndex = 0

That’s done it! Thank you very much for your input