Bug - Fixed $skill[Science! Fight with Internet Debate] claims a mystery misspelling

r16952. To reproduce:

  1. Enter in the gCLI:
    ash $skill[Science! Fight with Internet Debate]
  2. The gCLI outputs:
    Changing "Science! Fight with Internet Debate" to "Science! Fight with Internet Debate" would get rid of this message ()
  3. Copy/pasting that exact string back into the $skill[] cast produces the same output.

I thought this might be one of those weird situations where native KoL includes an extra space somewhere. But $skill[Science! Fight with Medicine] and $skill[Science! Fight with Rational Thought] work just fine, so I'm not sure.
 

lostcalpolydude

Developer
Staff member
The other two skills don't have a double space, that's why you aren't seeing anything there.

Code:
> ash $skill[Science!  Fight with Internet Debate]
gives the same warning, but
Code:
> ash $skill[Science! \ Fight with Internet Debate]
does not.

Something should probably be changed, ideally.
 

Bale

Minion
Something should probably be changed, ideally.

The fix would be a different error message. I propose it should say,

Code:
Changing "Science! Fight with Internet Debate" to "Science! \ Fight with Internet Debate" would get rid of this message ()

That would remove all confusion.
 
The question is, does it recognize that the issue is the double space? PaladinWhite's output indicates that the double space is being removed at some point along the line between whatever Mafia holds correct and the gCLI. Would this change involve the entire parsing mechanism?
 

Bale

Minion
Well, it isn't completely dissimilar from

Code:
> ash $item[earth wind and Firewater]

Changing "earth wind and Firewater" to "Earth\, Wind and Firewater" would get rid of this message ()

Note that in that example it puts a backslash before the comma. That gives me hope that the underlying code would support this fix without too much effort.
 

heeheehee

Developer
Staff member
All Mafia knows is that it didn't find an exact match (up to case), so it tells the user that it had to resort to fuzzy matching.
 

heeheehee

Developer
Staff member
Code:
> ashq $skill[debate]

Changing "debate" to "Science! \ Fight with Internet Debate" would get rid of this message ()

> ashq $item[snokebomb]

Changing "snokebomb" to "training scroll: \ Snokebomb" would get rid of this message ()
r16954.
 

heeheehee

Developer
Staff member
fwiw, it handles the comma case in exactly the same way, namely that it just replaces all instances of "," with "\\,". It handles triple (and more) spaces incorrectly, but for the time being, this is probably adequate.
 

Bale

Minion
For posterity I am noting that heeheehee's next commit, r16955, amended his work to handle triple and more spaces.

Great job, hee^3!
 

xKiv

Active member
The question is, does it recognize that the issue is the double space? PaladinWhite's output indicates that the double space is being removed at some point along the line between whatever Mafia holds correct and the gCLI. Would this change involve the entire parsing mechanism?

AFAIK, the extra space would get removed at two points:
1) copypasting the "correct" string from the gCLI message to $skill[] - gCLI only ever prints one space, no matter what amount of whitespace characters is actually contained in the printed string
so the copypasted string already contained only one space

2) using $skill[something with double spaces here] in the gCLI command promp - I *think* this will trim the extra spaces too? because the command prompt will trim them before the command even starts being interpretted?
(will the same thing happen in an ASH script file?)
 
Top