http://code.google.com/p/sorrows-mudlib/source/detail?r=193
Modified:
/trunk/games/room - simple/services/world.py
/trunk/games/room - simple/world/body.py
/trunk/games/room - simple/world/object.py
/trunk/mudlib/commands/move.py
=======================================
--- /trunk/games/room - simple/services/world.py Thu Mar 4 22:09:46 2010
+++ /trunk/games/room - simple/services/world.py Thu Dec 23 03:59:02 2010
@@ -29,6 +29,12 @@
ob.SetLongDescription("This is a chest.")
ob.MoveTo(room)
+ room2 = self.secondRoom = Room()
+ room2.SetShortDescription("A second room")
+ room2.SetLongDescription("This is a second room.")
+ room2.AddExit("north", room)
+ room.AddExit("south", room2)
+
def AddUser(self, user):
if self.bodiesByUsername.has_key(user.name):
raise RuntimeError("User", user.name, "already present")
=======================================
--- /trunk/games/room - simple/world/body.py Wed Feb 24 00:17:49 2010
+++ /trunk/games/room - simple/world/body.py Thu Dec 23 03:59:02 2010
@@ -13,7 +13,5 @@
def MoveDirection(self, verb):
destinationRoom = self.container.GetExitRoom(verb)
if destinationRoom:
- self.MoveTo(destinationRoom)
- return True
- return False
-
+ return self.MoveTo(destinationRoom)
+
=======================================
--- /trunk/games/room - simple/world/object.py Tue Apr 27 22:40:40 2010
+++ /trunk/games/room - simple/world/object.py Thu Dec 23 03:59:02 2010
@@ -77,4 +77,5 @@
dest.AddObject(self)
self.container = dest
-
+ return dest
+
=======================================
--- /trunk/mudlib/commands/move.py Tue Apr 27 22:24:50 2010
+++ /trunk/mudlib/commands/move.py Thu Dec 23 03:59:02 2010
@@ -8,7 +8,8 @@
def syntax_(context):
direction = util.ResolveDirection(context.verb)
- if context.body.MoveDirection(direction):
- context.user.Tell(context.room.LookString(context.body))
+ destRoom = context.body.MoveDirection(direction)
+ if destRoom is not None:
+ context.user.Tell(destRoom.LookString(context.body))
else:
context.user.Tell("You can't go %s." % direction)