Rooms pointing to a room
Posted: Sat Oct 25, 2014 3:22 pm
Hi!
I am interested in finding what rooms have exit to a certain room.
I know that I can always just loop through all the rooms, check if any of their exit points to the room, but that is very inefficient, and my map is over 30.000 room (and growing), this search freezes up the UI (noticably, not for a long period, 1-1.5 sec). I want to get rid of this freeze.
My attempt to make the resolution more efficient is by overwriting exit, stub, specialexit functions and update the target room's "pointshere" userdata anytime these functions are called.
I was really happy to see it do exactly what I wanted... except mapper UI windows don't make use of any of these functions, they must use something internal. Meaning if I deleted/added an exit through the ui, my "pointshere" userdata did not update.
Wondering if I am just over complicating things and there is an existing function that does this for me. Maybe I've missed it.
I am interested in finding what rooms have exit to a certain room.
I know that I can always just loop through all the rooms, check if any of their exit points to the room, but that is very inefficient, and my map is over 30.000 room (and growing), this search freezes up the UI (noticably, not for a long period, 1-1.5 sec). I want to get rid of this freeze.
My attempt to make the resolution more efficient is by overwriting exit, stub, specialexit functions and update the target room's "pointshere" userdata anytime these functions are called.
I was really happy to see it do exactly what I wanted... except mapper UI windows don't make use of any of these functions, they must use something internal. Meaning if I deleted/added an exit through the ui, my "pointshere" userdata did not update.
Wondering if I am just over complicating things and there is an existing function that does this for me. Maybe I've missed it.