Merge pull request #16067 from SandPoot/bad-math

Fixes hud rendering issues from math inaccuracies.
This commit is contained in:
deathride58
2024-04-01 17:38:41 -04:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -108,7 +108,8 @@
#define TORADIANS(degrees) ((degrees) * 0.0174532925)
/// Gets shift x that would be required the bitflag (1<<x)
#define TOBITSHIFT(bit) ( log(2, bit) )
/// We need the round because log has floating-point inaccuracy, and if we undershoot at all on list indexing we'll get the wrong index.
#define TOBITSHIFT(bit) ( round(log(2, bit), 1) )
// Will filter out extra rotations and negative rotations
// E.g: 540 becomes 180. -180 becomes 180.

View File

@@ -231,7 +231,7 @@
static_inventory += using
inv_box = new /atom/movable/screen/inventory()
inv_box.name = "i_clothing"
inv_box.name = "uniform"
inv_box.icon = ui_style
inv_box.slot_id = ITEM_SLOT_ICLOTHING
inv_box.icon_state = "uniform"
@@ -239,7 +239,7 @@
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
inv_box.name = "o_clothing"
inv_box.name = "suit"
inv_box.icon = ui_style
inv_box.slot_id = ITEM_SLOT_OCLOTHING
inv_box.icon_state = "suit"
@@ -295,7 +295,7 @@
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
inv_box.name = "storage1"
inv_box.name = "left pocket"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
@@ -303,7 +303,7 @@
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory()
inv_box.name = "storage2"
inv_box.name = "right pocket"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2