Commits

mcc  committed 4ea4669

Don't mess up id_generator on twhy load

  • Participants
  • Parent commits 9e162f6

Comments (0)

Files changed (1)

File server/server.py

 						if options.debug > 1:
 							print("\tLoading: Create tank %d" % gid)
 						t = Genome(gid, True)
+						t.generation_count = int(tank.getAttribute("gc"))
 						spawn = tank.firstChild # Iter spawns
 						while spawn:
 							s = Spec(gid, True)
 							t.specs[sid] = s
 							t.specs_stack.append(s)
 							spawn = spawn.nextSibling
+						t.id_generator = max(t.id_generator, sid)
 						t.last_valid = t.specs_stack[0]
 						t.specs_stack.reverse()
 						self.alltanks[gid] = t
 						print("Loading: BREED")
 				node = node.nextSibling
 			
-			self.tanks = self.alltanks
+			self.tanks = {}
+			for i,t in self.alltanks.iteritems():
+				if options.shelf_size <= 0 or i-1 < options.shelf_size:
+					self.tanks[i] = t
 	
 	def any(self, post_obj):
 		if player_hits(post_obj) > options.shelf_after: