Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setExitWeight() works on non-existent exits #541

Closed
vadi2 opened this issue Mar 31, 2017 · 7 comments
Closed

setExitWeight() works on non-existent exits #541

vadi2 opened this issue Mar 31, 2017 · 7 comments
Labels

Comments

@vadi2
Copy link
Member

vadi2 commented Mar 31, 2017

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

Launchpad Details: #LP1097543 Vadim Peretokin - 2013-01-09 01:41:29 +0000

@vadi2 vadi2 added the low label Mar 31, 2017
@vadi2
Copy link
Member Author

vadi2 commented Mar 31, 2017

Is there a deleterious effect to this?

Launchpad Details: #LPC Chris - 2013-03-08 02:47:02 +0000

@vadi2
Copy link
Member Author

vadi2 commented Mar 31, 2017

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?

Launchpad Details: #LPC Heiko - 2013-03-08 07:41:14 +0000

@vadi2
Copy link
Member Author

vadi2 commented Mar 31, 2017

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

Launchpad Details: #LPC Vadim Peretokin - 2013-03-08 21:20:24 +0000

@vadi2
Copy link
Member Author

vadi2 commented Mar 31, 2017

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!

Launchpad Details: #LPC Stephen Lyons - 2016-07-19 01:33:03 +0000

@vadi2
Copy link
Member Author

vadi2 commented Mar 31, 2017

...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.

Launchpad Details: #LPC Stephen Lyons - 2016-07-19 01:38:44 +0000

@vadi2
Copy link
Member Author

vadi2 commented Apr 5, 2017

Don't believe this is an issue anymore due to https://github.com/Mudlet/Mudlet/blob/development/src/TLuaInterpreter.cpp#L8750

@vadi2 vadi2 closed this as completed Apr 5, 2017
@SlySven
Copy link
Member

SlySven commented Apr 5, 2017

This is duplicated by #539 and #554 but is the one that has all the LP bug posts on this topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants