From c3ce2ebcd7c134df9c02c202d90159777693d2cc Mon Sep 17 00:00:00 2001 From: Scyfris Talivinsky Date: Sat, 30 Sep 2017 18:18:54 -0700 Subject: [PATCH] Fix locationless spawned objects Spawned objects were not getting locations assigned to them. By default the locations should be assigned to the caller's location. --- evennia/commands/default/building.py | 2 +- evennia/utils/spawner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 61a46bde30..9170f3c9ff 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -2718,7 +2718,7 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS): self.caller.msg("The prototype must be a prototype key or a Python dictionary.") return - if "noloc" in self.switches and not "location" not in prototype: + if "noloc" not in self.switches and "location" not in prototype: prototype["location"] = self.caller.location for obj in spawn(prototype): diff --git a/evennia/utils/spawner.py b/evennia/utils/spawner.py index 423fc8225b..4a8ac946c8 100644 --- a/evennia/utils/spawner.py +++ b/evennia/utils/spawner.py @@ -100,7 +100,7 @@ _CREATE_OBJECT_KWARGS = ("key", "location", "home", "destination") def _handle_dbref(inp): - dbid_to_obj(inp, ObjectDB) + return dbid_to_obj(inp, ObjectDB) def _validate_prototype(key, prototype, protparents, visited):