Fixed help command #182

Merged
chromaticpipe merged 2 commits from fixedhelp into Saturn-Next 2025-06-07 11:54:36 +02:00
chromaticpipe commented 2025-06-03 20:55:25 +02:00 (Migrated from github.com)

Fixes the help command outputting fixed point numbers that are not readable to the average person.
This was because if a variable was a float, eg. fov, the fixed point numbers used to represent it were not being converted back into normal integers leading to an output that looks kind of like this:

 $help fov
Variable fov:
  flags: AUTOSAVE FLOAT ACTION 
  range from 327680 to 11730944
 Current value: 5898240

Now if you convert all those numbers to integers by shifting right by FRACBITS You will get 5-179 for the range and 90 for the current value and by properly converting those numbers you get something more like this

$help fov
Variable fov:
  flags: AUTOSAVE FLOAT ACTION 
  range from 5 to 179
 Current value: 90

Which is obviously way more readable to the average person.
As a bonus this patch also strips any trailing zeroes from CVars as they are unnecessary

Fixes the help command outputting fixed point numbers that are not readable to the average person. This was because if a variable was a float, eg. `fov`, the fixed point numbers used to represent it were not being converted back into normal integers leading to an output that looks kind of like this: ``` $help fov Variable fov: flags: AUTOSAVE FLOAT ACTION range from 327680 to 11730944 Current value: 5898240 ``` Now if you convert all those numbers to integers by shifting right by `FRACBITS` You will get 5-179 for the range and 90 for the current value and by properly converting those numbers you get something more like this ``` $help fov Variable fov: flags: AUTOSAVE FLOAT ACTION range from 5 to 179 Current value: 90 ``` Which is obviously way more readable to the average person. As a bonus this patch also strips any trailing zeroes from CVars as they are unnecessary
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: saturn/SRB2Kart-Saturn#182