Fixed bug in dark room. The mob currently has issues accepting exit locks

This commit is contained in:
Griatch 2015-02-22 14:07:42 +01:00
parent 56104d9a1d
commit 4e11b2b5b5
3 changed files with 2 additions and 6 deletions

View file

@ -301,14 +301,9 @@ class Mob(tut_objects.TutorialObject):
# no target found, look for an exit.
exits = [exi for exi in self.location.exits
if exi.access(self, "traverse")]
last_location = self.ndb.last_location
if exits:
# randomly pick an exit
exit = random.choice(self.location.exits)
if len(exits) > 1 and exit.destination == last_location:
# don't go back the same way we came if we
# can avoid it.
return
# move there.
self.move_to(exit.destination)
else:

View file

@ -473,7 +473,7 @@ class DarkRoom(TutorialRoom):
self.db.tutorial_info = "This is a room with custom command sets on itself."
# the room starts dark.
self.db.is_lit = False
self.cmdsets.add(DarkCmdSet, permanent=True)
self.cmdset.add(DarkCmdSet, permanent=True)
def at_init(self):
"""

View file

@ -540,6 +540,7 @@ def has_player(accessing_obj, accessed_obj, *args, **kwargs):
This is a useful lock for traverse-locking Exits to restrain NPC
mobiles from moving outside their areas.
"""
print "lock:", accessing_obj, accessed_obj, accessing_obj.has_player
return hasattr(accessing_obj, "has_player") and accessing_obj.has_player
def serversetting(accessing_obj, accessed_obj, *args, **kwargs):