Re: [Code] OLC and overlapping rooms

From: Sammy (
Date: 02/16/97

On Sat, 15 Feb 1997, Rasdan wrote:

> Hey all,
>     I am trying to put a check within the olc I use (obuild) to make sure
> that a player cannot make overlapping rooms (ie: room creation sequence:
> n (room starting in = 100)
> e - 101
> s - 102
> w - 103
> n - 104 (BAD)
>     Instead, what I would like to have done is for the code to 
> automatically create the w-n exit, instead of going to 104, to go to 100.

Off the top of my head, the simplest (not necessarily best) way to do this
is create a 100x100 array around the starting room (xx00) when a builder
enters the zone.  The array could be byte types that point to room numbers
0, 1, 2, etc, with -1 as an unused location.  Plot all the current rooms
in the big array, and log errors when rooms overlap.  Then when the
builder is walking around, overlap causes a linking rather than a new
room, and any movement that doesn't cause overlap is a valid new room

Hmm that's 10k per zone, assuming 100-room zones.  I think that's
acceptable if it's a temporary allocation.  You may want to have a flag to
turn off this behavior so you can do weird stuff like spiral staircases.


| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   |
|    Or send 'info circle' to     |

This archive was generated by hypermail 2b30 : 12/18/00 PST