[ScryMUD] SVN Commit Info r724 - branches/version-2-1/mud/grrmud/server

scrymud at wanfear.com scrymud at wanfear.com
Thu Dec 2 02:44:57 PST 2004


Author: eroper
Date: 2004-12-02 02:44:56 -0800 (Thu, 02 Dec 2004)
New Revision: 724

Modified:
   branches/version-2-1/mud/grrmud/server/vehicle.cc
Log:
Hopefully this will prevent vehicle self-containment caused when a path sends
a vehicle in the same direction as the vehicle-entrace from the current room.
Builders will be able to be slightly more lazy with i_th while pathing.

--Khaav


Modified: branches/version-2-1/mud/grrmud/server/vehicle.cc
===================================================================
--- branches/version-2-1/mud/grrmud/server/vehicle.cc	2004-12-02 05:45:06 UTC (rev 723)
+++ branches/version-2-1/mud/grrmud/server/vehicle.cc	2004-12-02 10:44:56 UTC (rev 724)
@@ -129,6 +129,7 @@
 
 int vehicle::move(int see_bit, int i_th, const String& exit_direction) {
    int dest;
+   int i_th_incr = 0;
    String buf(200);
 
    if (mudlog.ofLevel(DBG)) {
@@ -145,6 +146,20 @@
 
    //log("Got exit_dr_ptr.\n");
 
+   //if our vehicle creates a south in room and then tries to go south we end
+   //up self-containing. Now of course one can set i_th in the path, but then
+   //again, this gets ridiculously annoying on very long paths. It's also
+   //highly prone to human error. In the event that we attempt to
+   //self-contain, walk through all the doors (increasingly from i_th as
+   //passed) until we (hopefully) find one that isn't us. In the event that we
+   //fail to locate one, things should work as they did before (see below).
+   //Please note that we only attempt doors in the direction requested.
+   while ( exit_dr_ptr && ( abs(exit_dr_ptr->destination) == getRoomNum() ) ) {
+      exit_dr_ptr = door::findDoor(room_list[in_room].DOORS, i_th+i_th_incr,
+            &exit_direction, see_bit, room_list[in_room].getVisBit());
+      i_th_incr++;
+   }
+
    if (!exit_dr_ptr) {
       mudlog.log(WRN, "WARNING:  destination dr_ptr is NULL in move_room.\n");
       Sprintf(buf, "Your vehicle cannot go %S.\n", &exit_direction);




More information about the ScryMUD mailing list