Closed satoshinm closed 7 years ago
Completed adding bool
s everywhere, or at least anywhere I could find int
being used as a boolean. This is not without a downside: other forks of Craft may be difficult to merge back in, incorporating their changes. Can't go back easily.
But it does make the code significantly clearer, especially as parameters are passed in (is 0
meant to be an ordinal number, or false
? no longer need to guess. same with 1
vs true
), and in function return values (bool
will always be one of two values, such as in bool hit_test_face
, it returns true if the hit test was successful, not the block type hit, unlike int hit_test
!)
https://github.com/satoshinm/NetCraft/issues/109
https://en.wikipedia.org/wiki/C_data_types#stdbool.h