eglaysher / rlvm

RealLive clone for Linux and OSX
http://rlvm.net
GNU General Public License v3.0
150 stars 25 forks source link

When % or * is not followed by A-Z treat the character literally. #87

Closed kroki closed 5 years ago

kroki commented 5 years ago

For instance CLANNAD FV has

"【%B】「よぅし、特別に、全部10%引きにしてやる」"

among 20 phrases where (some) "%" are literal.

kroki commented 5 years ago

It's also worth noting that the code didn't fail on phrases like

"100%勘違いさせてくれる挨拶ありがとう。"

because when the exception was thrown the code in src/machine/rlmachine.cc used the original string:

  try {
    parseNames(*memory_, cp932str, name_parsed_text);
  }
  catch (rlvm::Exception& e) {
    // WEIRD: Sometimes rldev (and the official compiler?) will generate strings
    // that aren't valid shift_jis. Fall back while I figure out how to handle
    // this.
    name_parsed_text = cp932str;
  }

But for phrases like

"【*B】「1%未満てとこだけどな」"

it was failing to resolve "*B".

Perhaps parseNames() won't throw anything after the fix is merged, but I didn't risk to remove try {} catch {} logic.

eglaysher commented 5 years ago

Thank you!