Merge pull request #3541 from InspectorCaracal/improve-obj-search

Rework Object searching to behave more consistently
This commit is contained in:
Griatch 2024-09-29 09:42:49 +02:00 committed by GitHub
commit e01f79acc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 110 additions and 106 deletions

View file

@ -527,6 +527,9 @@ class CmdRemove(MuxCommand):
help_category = "clothing"
def func(self):
if not self.args:
self.caller.msg("Usage: remove <worn clothing object>")
return
clothing = self.caller.search(self.args, candidates=self.caller.contents)
if not clothing:
self.caller.msg("You don't have anything like that.")

View file

@ -85,7 +85,7 @@ class TestClothingCmd(BaseEvenniaCommandTest):
)
# Test remove command.
self.call(clothing.CmdRemove(), "", "Could not find ''.", caller=self.wearer)
self.call(clothing.CmdRemove(), "", "Usage: remove <worn clothing object>", caller=self.wearer)
self.call(
clothing.CmdRemove(),
"hat",