diff --git a/CHANGELOG.md b/CHANGELOG.md index f92f1c6f18..e288ab3265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,6 +155,8 @@ Up requirements to Django 4.0+, Twisted 22+, Python 3.9 or 3.10 from a web view. - Update `evennia.utils.logger` to use Twisted's new logging API. No change in Evennia API except more standard aliases logger.error/info/exception/debug etc can now be used. +- Have `type/force` default to `update`-mode rather than `reset`mode and add more verbose + warning when using reset mode. ## Evennia 0.9.5 diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 0ce89949bb..81fd1d4076 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -25,6 +25,7 @@ from evennia.utils.utils import ( format_grid, ) from evennia.utils.eveditor import EvEditor +from evennia.utils.evmenu import ask_yes_no from evennia.utils.evmore import EvMore from evennia.utils.evtable import EvTable from evennia.prototypes import spawner, prototypes as protlib, menus as olc_menus @@ -2212,11 +2213,22 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS): "Use /force to override." ) else: - update = "update" in self.switches reset = "reset" in self.switches + update = "update" in self.switches or not reset # default to update + hooks = "at_object_creation" if update and not reset else "all" old_typeclass_path = obj.typeclass_path + if reset: + answer = yield("|yNote that this will reset the object back to its typeclass' default state, " + "removing any custom locks/perms/attributes etc that may have been added " + "by an explicit create_object call. Use `update` or type/force instead in order " + "to keep such data. " + "Continue [Y]/N?|n") + if answer.upper() == "N": + caller.msg("Aborted.") + return + # special prompt for the user in cases where we want # to confirm changes. if "prototype" in self.switches: @@ -2262,7 +2274,7 @@ class CmdTypeclass(COMMAND_DEFAULT_CLASS): if reset: string += " All old attributes where deleted before the swap." else: - string += " Attributes set before swap were not removed." + string += " Attributes set before swap were not removed\n(use `swap` or `type/reset` to clear all)." if "prototype" in self.switches and prototype_success: string += ( " Prototype '%s' was successfully applied over the object type."