1. mcc
  2. evo

Commits

mcc  committed 9e162f6

Can load twhys

  • Participants
  • Parent commits ec1851e
  • Branches default

Comments (0)

Files changed (1)

File server/server.py

View file
 
 def randomfromdict(s):
 	return s[randomfrom(s.keys())]
+	
+def top(s):
+	ls = len(s)
+	if ls > 0:
+		return s[ls-1]
+	return None
 
 player_db = {}
 def player_hits(post_obj):
 					if options.debug > 1:
 						print("Loading: TWHY")
 					self.report(node)
+					gid = int(node.getAttribute("gid"))
+					sid = int(node.getAttribute("sid"))
+					t = self.alltanks[gid]
+					s = top(t.specs_stack)
+					if s and s.sid == sid:
+						if options.debug > 1:
+							print("\tLoading: Popping gid %d, sid %d" % (gid, sid))
+						t.specs_stack.pop()
 					
 				elif node.nodeName == "breed":
 					if options.debug > 1: