Hopefully fix variable setting

This commit is contained in:
Ruben van de Ven 2019-11-12 00:19:50 +01:00
parent 750406b784
commit b0c4a35242

View file

@ -1337,11 +1337,11 @@ class Story(object):
if name not in self.variables: if name not in self.variables:
self.logger.warn(f"Set variable that is not needed in the story: {name}") self.logger.warn(f"Set variable that is not needed in the story: {name}")
else: else:
self.logger.debug(f"Set variable {name} to {value}") if self.variableValues[name] == value:
self.logger.debug(f"Skip double setting of variable {name} to {value}")
if self.variableValues[name] == value: return
self.logger.debug(f"Skip double setting of variable {name} to {value}") else:
return self.logger.debug(f"Set variable {name} to {value}")
self.variableValues[name] = value self.variableValues[name] = value
if store: if store: