pret / pokeemerald

Decompilation of Pokémon Emerald

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mapjson should error out on empty string fields.

luckytyphlosion opened this issue · comments

Currently, mapjson allows empty string fields, which is not a meaningful definition. If a field expects a string and is specified with an empty string, then the output *.inc file will simply have no data in the .Xbyte directive. GNU Assembler allows no expression to be specified within an .Xbyte directive (which will simply not insert any bytes), so the output *.inc file will be assembled without any error. As a result, all fields after the missing expression will be placed in incorrect struct offsets, and will most likely lead to in-game crashes.

There's more room for potential error checking (e.g. you can add commas in a string -> Xbyte field and it will result in multiple Xbytes being output), but inputting in empty strings is the most likely error to run into.

Sure seems like a weird bug, might be tough yet not impossible to fix