Simplified some boolean sets.
Removed unnecessary storing of varibles and just clean up the memory on each iteration.
Moved dust_record type to local scope as it was not being used elsewhere. Changed dust references to dust_record to make it easier to find later.
Changed return type of dust_available to be bool and fixed function to do the same. Removed reference from header as it was not being used outside local file.
Removed unnecessary else statements when if just returned.
Fixed weird if else if indentation.
Collapse if statements where possible.
Removed redundant parenthesis wrapping.
Replaced if based bound checks with math functions where possible.