Mudlet-2.0-test4 released

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Mudlet-2.0-test4 released

Post by chris »

The "key" is not the command string. Look at the code in TRoom, which is called from TLuaInterpretter via pHost->mpMap->rooms[id_from]->addSpecialExit( id_to, _dir ). TRoom checks if the room to id exists, and if so, it overwrites the value with other.replace(to,_cmd). I was wrong about our data structure, as it's actually a QMultiMap in the first place, but regardless, that part of the loop with insertMulti is never reached if a room exit is already defined. It has nothing to do with my getSpecialExit() function change, I reverted that and the problem results with getSpecialExitSwap() as well. This isn't a lua problem, it's a c++ problem.

Here's the relevant except from the docs:
QMap<Key, T>::iterator QMultiMap::replace ( const Key & key, const T & value )
Inserts a new item with the key key and a value of value.
If there is already an item with the key key, that item's value is replaced with value.
If there are multiple items with the key key, the most recently inserted item's value is replaced with value.
The code should be a variant of this:
Code: [show] | [select all] lua
   while...
            if (it.value() == _cmd)
                other.replace( to, _cmd );
            else
                other.insertMulti( to, _cmd );
            return;
My other posting above meant that in almost every case, special exits will be unique, but they don't have to be.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Mudlet-2.0-test4 released

Post by Heiko »

Ah now I get it. This would be a clear bug. I'm going to look at the code and fix the issue tonight.

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Mudlet-2.0-test4 released

Post by Omit »

Have the issues with Special Exits been corrected? If so, where would I find a version with the fix?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet-2.0-test4 released

Post by Vadi »

There has not yet been an update for that.

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Mudlet-2.0-test4 released

Post by Omit »

Hmm, I have been continuing to test this and I found a situation that will cause Mulet to crash.

Any attempt to edit the Special Exits by right-clicking a room on the map and selecting exits causes a crash. (Even if all you do is select one of those exits)

Likely this is related to the other issues with special exits but I had not seen where anyone else has mentioned this.

(On an unrelated matter, I can't tell you how much the left click map panning behavior bothers me, especially after a 3 cups of coffee and my hands shake slightly. I would love a way to disable this entirely.... cntl+click is not very intuitive IMHO, and ANY movement of the mouse causes the map to move considerably... mostly this is just me bitching, the other matter is much more important.)

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Mudlet-2.0-test4 released

Post by Omit »

Hmm... found a bug with addAreaName....
any newly added areas DO NOT show up in the area dropdown list (on the mapper) until after a restart of mudlet.
(There may be more related bugs but am unsure as I have not completly tested my code yet.)

Oh... and if a room is assigned to an area that does not have a name... it should be given one automaticly... it does not appear to be possible to rename an unnamed area.( and may cause other problems...)

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Mudlet-2.0-test4 released

Post by chris »

I'll check on the first one and patch my hub. Good catch.

For your second point, why not just have it catch that in your script? I wouldn't want that automation done automatically for me.

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Mudlet-2.0-test4 released

Post by Omit »

my scripting was written before area names... so... I had lots of areas without names... but was unable to rename an area that did not have a name... so... easy fix is to add a defualt name if none exists (least that way the user can change the areas name)... I have not tested completely but I think that having unnamed areas will also cause the getAreaTable() function to fail... so... much better to have a name(even one you don't want) than no name at all.

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Mudlet-2.0-test4 released

Post by Omit »

Vadi wrote:It seems centerview doesn't work anymore once you use the area scroller to select another area, so walking about after it leaves the mapper in a 'broken' state.
I am running into this issue.(has this been fixed?)

In addition, I noticed that the area pickers selection does not get set to the correct area upon calling centerview(at least when the map is initially loaded, mine seems to defualt to the area first in the list alphabeticly even tho the room displayed/centered on is in a differant area)

EDIT: Further testing shows that the area picker selection is not being updated when you change areas(by moving on the map to a new area). It is not limited to when the map is initially loaded.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Mudlet-2.0-test4 released

Post by chris »

The centerview issue is fixed as far as I can tell (using my repository). I also fixed the area picker selection to sync with centerview.

Edit: For the rooms without an area, they default to zone 0, which is nameless.

Post Reply