Fixing condition where state could be only sort of successful.

This commit is contained in:
Julie Iaccarino 2020-02-16 07:38:09 -08:00
parent feb71858db
commit 7419b3a82d

View file

@ -2102,7 +2102,8 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS):
if "prototype" in self.switches: if "prototype" in self.switches:
modified = spawner.batch_update_objects_with_prototype(prototype, objects=[obj]) modified = spawner.batch_update_objects_with_prototype(prototype, objects=[obj])
if modified == 0: prototype_success = modified > 0
if not prototype_success:
caller.msg("Prototype %s failed to apply." % prototype["key"]) caller.msg("Prototype %s failed to apply." % prototype["key"])
if is_same: if is_same:
@ -2121,7 +2122,7 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS):
string += " All old attributes where deleted before the swap." string += " All old attributes where deleted before the swap."
else: else:
string += " Attributes set before swap were not removed." string += " Attributes set before swap were not removed."
if "prototype" in self.switches: if "prototype" in self.switches and prototype_success:
string += " Prototype '%s' was successfully applied over the object type." % prototype["key"] string += " Prototype '%s' was successfully applied over the object type." % prototype["key"]
caller.msg(string) caller.msg(string)