Bug in doors?

this code:

(intro)
                "Test" 
			    (try [look])

#player
(current player *)
(* is #in #room_b)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#room_b
(name *)        room b
(proper *)
(room *)
(look *)        This is Room B, there is a door to the north and Room A is to the south.
(from * go #south to #room_a)
(from * go #north through #door to #room_c)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#door
(name *)        wooden test door 
(door *)
(openable *)
(* is closed)
(descr *)       It's an ordinary wooden door.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#room_c
(name *)        room c
(proper *)
(room *)
(look *)        This is Room C, there is a door to the south.
(from * go #south through #door to #room_b) 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%#room_a
%%(name *)        room a
%%(proper *)
%%(room *)
%%(look *)        This is Room A, Room B is to the north
%%(from * go #north to #room_b) 

will not work. the parser knows there is a door to the north (first trying to open the door to the north) but then it reports that the door isn’t there.

if you comment OUT the link from room b to room a it works fine. this seems to be confusing the compiler somehow.

is this a bug or am i misunderstanding something? manually adding an (attracts #door) for each room fixes the problem but aren’t doors supposed to be automatically ‘attracted’ to the rooms on each side of them? here, that seems to be working incorrectly.

1 Like

Your code snippet works for me.

Edit: This code from the library makes all doors attracted to the rooms they have connections to:

($Room attracts $Obj)
	*(from $Room go $ to $Obj)
	~(direction $Obj)
	~(room $Obj)

Try this in the debugger with the non-working code, you should see the output given:

> *(from #room_b go $ to $)
Query succeeded: (from #room_b go #south to #room_a)
Query succeeded: (from #room_b go #north to #door)
1 Like

oops. i found my mistake.

i had made a teeny inconsequential change in stdlib.dg that i’d forgotten about. i took that out and problem solved. (i think i orig. put it in as a test and it stuck).

damn, one of these days i’ll find an actual bug and not just post my own mistakes :slight_smile:

2 Likes