OpenTTD icon indicating copy to clipboard operation
OpenTTD copied to clipboard

Codechange: use {HEX} instead of custom hex format and {(RAW_)STRING}

Open rubidium42 opened this issue 1 year ago • 0 comments

Motivation / Problem

We have a nice {HEX} string command, but somehow we insist in formatting the string ourselves and then using SetDParamStr.

Description

Use {HEX} over {RAW_STRING}. This does remove forcing the number to be at least 4 digits, which has been insufficient for the bigger map sizes since they have been introduced.

Limitations

There is some discussion whether it should be just decimal or exist at all...

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

rubidium42 avatar Feb 15 '24 21:02 rubidium42