Referee Help for building ogres

With my level witch rebellion, i want to put in a referee to build ogres. However, I get an infinite loop. Link to my level editor. CodeCombat - Coding games to learn Python and JavaScript Can someone please submit a patch that allows the referee to build stuff? (i get an infinite loop.)