--- deliantra/server/random_maps/layout.C 2010/07/05 00:07:21 1.24
+++ deliantra/server/random_maps/layout.C 2012/10/29 23:55:54 1.30
@@ -1,28 +1,28 @@
/*
* This file is part of Deliantra, the Roguelike Realtime MMORPG.
- *
- * Copyright (©) 2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
- * Copyright (©) Crossfire Development Team (restored, original file without copyright notice)
- *
+ *
+ * Copyright (©) 2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
+ * Copyright (©) 1994-2004 Crossfire Development Team (restored, original file without copyright notice)
+ *
* Deliantra is free software: you can redistribute it and/or modify it under
* the terms of the Affero GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the Affero GNU General Public License
* and the GNU General Public License along with this program. If not, see
* .
- *
+ *
* The authors can be reached via e-mail to
*/
#include
-#include
+#include
#include
void noinline
@@ -314,11 +314,17 @@
// phase 2, while we have seeds, if
// seed is empty, floodfill, else grow
+ int rem_index = 0; // used to remove "somewhat ordered"
+
while (seeds.size)
{
coroapi::cede_to_tick ();
- point p = seeds.remove (rmg_rndm (seeds.size));
+ int i = perturb
+ ? rmg_rndm (max (0, seeds.size - 8), seeds.size - 1)
+ : rem_index ++ % seeds.size;
+
+ point p = seeds.remove (i);
x = p.x;
y = p.y;
@@ -1009,14 +1015,15 @@
demo ()
{
rmg_rndm.seed (time (0));
+ extern void hack();hack ();
for(int i=1;i<100;i++)
{
layout maze (40, 30);
- gen_village (maze);
- maze.doorify ();
+ maze.fill_rand (99);
+ maze.border ();
+ maze.isolation_remover (2);
maze.print ();
- exit(0);
}
exit (1);