[DGD] Melville - Attention: Stephen Schmidt
Stephen Schmidt
schmidsj at union.edu
Mon Jan 20 15:08:18 CET 2003
On Mon, 20 Jan 2003, Vampyr Twilight wrote:
> Another note on Melville, why am I only able to add up to two exits per
> room?
It's a bug in Melville. You may have an outdated version of Melville;
I'm fairly sure I fixed this bug in 0.9.1 or perhaps even 0.9. The
problem occurs when the room tries to print a list of three or more
exits.
> The line in question is: all_but_last = exits - exits[map_sizeof(exits)-1]
> ;
This line tries to use - as an operator on mappings, which doesn't
work in DGD.
The code in Melville 0.9.1, which handles this correctly, is
included below. The four lines marked with -> are the ones that
handle the case of more than two exits. Make your code match
this code (I think you only have to change one or two lines)
and then it should work fine.
Steve/Moby
if (!exits || map_sizeof(exits)==0) {
value += "There are no obvious exits.\n" ;
} else {
if (map_sizeof(exits)==1) {
list = map_indices(exits)[0] ;
value += "The only obvious exit is "+list+".\n" ;
} else {
if (map_sizeof(exits)==2) {
list = map_indices(exits)[0]+" and "+map_indices(exits)[1] ;
} else {
-> frog = map_indices(exits) ;
-> all_but_last = frog[0..sizeof(frog)-2] ;
-> list = implode(all_but_last,", ") ;
-> list += ", and "+frog[sizeof(frog)-1] ;
}
value += "Obvious exits are "+list+".\n" ;
}
}
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list