mirror of https://github.com/pret/pokecrystal.git
attempts to stop a recursion limit error
This commit is contained in:
parent
2de204cdb5
commit
1021728fb3
|
@ -1263,8 +1263,10 @@ class PointerLabelParam(MultiByteParam):
|
||||||
|
|
||||||
def get_dependencies(self):
|
def get_dependencies(self):
|
||||||
dependencies = []
|
dependencies = []
|
||||||
|
if self.parsed_address == self.address:
|
||||||
|
return dependencies
|
||||||
thing = script_parse_table[self.parsed_address]
|
thing = script_parse_table[self.parsed_address]
|
||||||
if thing and thing.address == self.parsed_address:
|
if thing and thing.address == self.parsed_address and not (thing is self):
|
||||||
if self.debug:
|
if self.debug:
|
||||||
print "parsed address is: " + hex(self.parsed_address) + " with label: " + thing.label + " of type: " + str(thing.__class__)
|
print "parsed address is: " + hex(self.parsed_address) + " with label: " + thing.label + " of type: " + str(thing.__class__)
|
||||||
dependencies.append(thing)
|
dependencies.append(thing)
|
||||||
|
@ -1516,9 +1518,9 @@ class Command:
|
||||||
def get_dependencies(self):
|
def get_dependencies(self):
|
||||||
dependencies = []
|
dependencies = []
|
||||||
for (key, param) in self.params.items():
|
for (key, param) in self.params.items():
|
||||||
if hasattr(param, "get_dependencies"):
|
if hasattr(param, "get_dependencies") and param != self:
|
||||||
deps = param.get_dependencies()
|
deps = param.get_dependencies()
|
||||||
if deps != None:
|
if deps != None and not self in deps:
|
||||||
dependencies.extend(deps)
|
dependencies.extend(deps)
|
||||||
return dependencies
|
return dependencies
|
||||||
|
|
||||||
|
@ -4632,9 +4634,15 @@ class Asm:
|
||||||
if not found:
|
if not found:
|
||||||
raise Exception, "unable to insert object into Asm"
|
raise Exception, "unable to insert object into Asm"
|
||||||
return True
|
return True
|
||||||
def insert_single_with_dependencies(self, object):
|
def insert_single_with_dependencies(self, object0):
|
||||||
objects = get_dependencies_for(object) + [object]
|
objects = get_dependencies_for(object0) + [object0]
|
||||||
|
objects = list(set(objects))
|
||||||
for object in objects:
|
for object in objects:
|
||||||
|
if object in self.parts:
|
||||||
|
if self.debug:
|
||||||
|
print "already inserted -- object.__class__="+str(object.__class__)+" object is: "+str(object)+\
|
||||||
|
" for object.__class__="+str(object0.__class__)+" object="+str(object0)
|
||||||
|
continue
|
||||||
if self.debug:
|
if self.debug:
|
||||||
print "object.__class__="+str(object.__class__) + " object is: " + str(object)
|
print "object.__class__="+str(object.__class__) + " object is: " + str(object)
|
||||||
self.insert(object)
|
self.insert(object)
|
||||||
|
|
Loading…
Reference in New Issue