rmtew / incursion-roguelike

The legendary computer game Incursion: Hall of the Goblin King!
https://incursion-roguelike.net/
Other
7 stars 1 forks source link

Remove modified character checking functions #21

Closed HexDecimal closed 2 months ago

HexDecimal commented 2 months ago

Looking up the standard docs, 0x00 characters have the same results as 0x01. I can't find any way to explain or justify these macros, casting to unsigned char would've been more correct. Behavior is defined for ASCII characters, and for non-ASCII these are not the right tools anyways.

Related to #12

rmtew commented 2 months ago

For all I remember it's possible Julian encodes negative values in the input.

rmtew commented 2 months ago

Like this:

https://github.com/rmtew/incursion-roguelike/blob/master/inc/Item.h#L57

HexDecimal commented 2 months ago

That wouldn't be ideal, but it's solvable. I could make a slightly renamed function to handle these if it's an issue.

rmtew commented 2 months ago

I think the domain of each of these is pretty well known and falls in the positive range of the signed char. It should be safe even with whatever the heck Julian is doing IIUC.