setExitWeight() works on non-existent exits

Bug #1097543 reported by Vadim Peretokin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mudlet
Opinion
Low
Unassigned

Bug Description

setExitWeight() works on non-existent exits and remembers them - perhaps it shouldn't?

Heiko (koehnheiko)
Changed in mudlet:
importance: Undecided → Medium
Revision history for this message
Chris (chrismudlet) wrote :

Is there a deleterious effect to this?

Revision history for this message
Heiko (koehnheiko) wrote : Re: [Mudlet-makers] [Bug 1097543] Re: setExitWeight() works on non-existent exits

This would ensue a performance hit and is unnecessary imho.
Am 08.03.2013 03:47, schrieb Chris:
> Is there a deleterious effect to this?
>

Revision history for this message
Vadim Peretokin (vperetokin) wrote :

I do think it is necessary to have a quality API that helps the programmer
point out their mistakes instead of accepting invalid inputs.

Heiko (koehnheiko)
Changed in mudlet:
importance: Medium → High
importance: High → Low
Revision history for this message
Stephen Lyons (slysven) wrote :

Whilst doing a major re-factoring of the TRoom class I discovered that the current implementation of setExitWeight(...) and addCustomLine(...) are both broken in handling numeric (1 to 12) exit direction specifiers - the TLuaInterpreter::dirToString(...) function returns the WRONG key value to use to store the entered data into the TRoom members. The values used do not match the internal QString values that are uses i.e. comparing the dirToString(...) function return values and the values used for normal exitWeights and customLines are respectively:
 1 - "north" "n" "N"
 2 - "northeast" "ne" "NE"
 3 - "northwest" "nw" "NW"
 4 - "east" "e" "E"
 5 - "west" "w" "W"
 6 - "south" "s" "S"
 7 - "southeast" "se" "SE"
 8 - "southeast" "se" "SE"
 9 - "up" "up" "UP"
10 - "down" "down" "DOWN"
11 - "in" "in" "IN"
12 - "out" "ou" "OUT"

The T2DMap class will not correctly parse the first set of values as custom exit lines and the TMap route finding code will not associate them as exit weights either!

Currently a work around is to use the indicated strings for those specific function.

At the time of writing I am deep inside the TRoom class and hope to have a solution that merges all the various exit specific attributes (locks, stubs, weights, doors) into a common exit direction identifier scheme that is language independent for normal exits (uses a QFlag enum not strings to identify the direction) and can be use for special exits (uses a QString that is empty for normal strings and holds the name for special) as a QPair<T1,T2> which can be use as a unique key for ANY exit... it is going together well but it touches a lot of the map stuff!

Revision history for this message
Stephen Lyons (slysven) wrote :

...oh the code I am doing will address prevention of addition of exit weights on non-existent exits, this will then link to https://bugs.launchpad.net/mudlet/+bug/1114594.

Revision history for this message
Vadim Peretokin (vperetokin) wrote :

Migrating issues to Github, please follow the new discussion here: https://github.com/Mudlet/Mudlet/issues/541

This issue needs to be closed and there is no appropriate status, so will set it to "Opinion" just for migration purposes.

Changed in mudlet:
status: New → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.