This looks kind of ugly,but to help me code a little better, is there a faster or better way for this little function of mine? Or just perhaps a cleaner look?
In my mud engine, when a character moves to a new room, I create an instance of alsohere. Each area has the subtype room, and each room subtype alsohere, etc. And delete/renumber when they leave the room.
Any advice would be helpful. It works fine, and is fast enough right now. Suggetions?
In my mud engine, when a character moves to a new room, I create an instance of alsohere. Each area has the subtype room, and each room subtype alsohere, etc. And delete/renumber when they leave the room.
Any advice would be helpful. It works fine, and is fast enough right now. Suggetions?
Function AddAlsohere(p.player) ax=0:xa=0 While axo=0 If area(p\curr_area)\ro[p\curr_room]\ro2[xa]=Null Then area(p\curr_area)\ro[p\curr_room]\ro2[xa]=New alsohere area(p\curr_area)\ro[p\curr_room]\ro2[xa]\alsoname$=p\name$ area(p\curr_area)\ro[p\curr_room]\ro2[xa]\playerid=p\playerid p\alsoid=xa axo=1 EndIf xa=xa+1 Wend WriteLine p\stream, area(p\curr_area)\ro[p\curr_room]\ro2[p\alsoid]\alsoname$+" added ID: "+p\alsoid End Function