[ScryMUD] SVN Commit Info r774 - branches/people/eroper/automapper/mud/grrmud/server
scrymud at wanfear.com
scrymud at wanfear.com
Fri Dec 17 18:17:03 PST 2004
Author: eroper
Date: 2004-12-17 18:17:02 -0800 (Fri, 17 Dec 2004)
New Revision: 774
Modified:
branches/people/eroper/automapper/mud/grrmud/server/zone.cc
Log:
Now we only walk up/down *after* fully exploring the current z-layer. This
guarantees that up/down connections are correct as far as start/end rooms on
each z-layer. Essentially this forces any skewing to be done to paths between
rooms on the same z-layer rather than causing vertical collisions into the
wrong area (connection room) of a different z-layer. These same z-layer
distance skews/stretches are then easy to detect and fix due to the
config-distance vs. map distance warning flags. Essentially we won't push
these room numbers onto our BFS tree until we have exausted all same z-layer
breadths.
The next step is to produce multiple "sections" for each zone. This is, some
connecting zones have chains of rooms that don't connect to each other.
Currently these don't get mapped at all (only the first discovered chain is
mapped).
Modified: branches/people/eroper/automapper/mud/grrmud/server/zone.cc
===================================================================
--- branches/people/eroper/automapper/mud/grrmud/server/zone.cc 2004-12-18 01:15:01 UTC (rev 773)
+++ branches/people/eroper/automapper/mud/grrmud/server/zone.cc 2004-12-18 02:17:02 UTC (rev 774)
@@ -576,7 +576,7 @@
String tmp_buf(1000);
Cell<door *> cll;
door* ptr;
- int tmp_rm;
+ int tmp, tmp_rm;
int counter;
int x,y,z;
String buf(100);
@@ -601,6 +601,7 @@
Tree2<int> tree(start_room);
Tree2Cell<int> par(tree);
+ Tree2Cell<int> par2;
Tree2Cell<int> tcll;
List<path*> path_list(NULL);
@@ -609,6 +610,19 @@
Cell<zonepath*> zpath_cll(zpath_list);
Cell<maproom*> mrl_cll;
+ /* used so that we only walk up/down *after* fully exploring the current
+ * z-layer. This guarantees that up/down connections are correct as far as
+ * start/end rooms on each z-layer. Essentially this forces any skewing to
+ * be done to paths between rooms on the same z-layer rather than causing
+ * vertical collisions into the wrong area (connection room) of a different
+ * z-layer. These same z-layer distance skews/stretches are then easy to
+ * detect and fix due to the config-distance vs. map distance warning
+ * flags. Essentially we won't push these room numbers onto our BFS tree
+ * until we have exausted all same z-layer breadths.
+ */
+ List<int> vertical_rooms(0);
+ vertical_rooms.clear();
+ Cell<int> vr_cll;
maproom *cur_maproom;
maproom new_maproom;
@@ -826,7 +840,20 @@
(new_maproom.zone() == 17) || //garland shops & houses
(new_maproom.zone() == 22) //more garland shops & houses
) {
- par.Push_Child(tmp_rm);
+
+
+ /* if it's not a z-layer direction, add it to our tree,
+ * otherwise delay it until this z-layer is done
+ */
+ if (
+ (! strcmp((const char *)(*dr_dir), "up") == 0 ) &&
+ (! strcmp((const char *)(*dr_dir), "down") == 0 )
+ ) {
+ par.Push_Child(tmp_rm);
+ } else {
+ vertical_rooms.append(tmp_rm);
+ }
+
room_list[tmp_rm].setFlag(29, TRUE);
} else {
new_maproom.placeholder(true);
@@ -836,7 +863,22 @@
}//room isn't in list
}//doors left
+ par2 = par;
par.Next_Breadth();
+
+ /* if the current z-layer is depleted, push the vertical rooms that
+ * we've been queuing onto our tree
+ */
+ if ( (!par) && (!IsEmpty(vertical_rooms)) ) {
+ cerr << "Pushing vertical rooms...\n";
+ vertical_rooms.head(vr_cll);
+ while ( (tmp = vr_cll.next()) ) {
+ par2.Push_Child(tmp);
+ }
+ vertical_rooms.clear();
+ par = par2;
+ }
+
}//while par
tcll.Head(tree);
while ( tcll ) {
More information about the ScryMUD
mailing list