From 3b783a9cb2119f9fad50cc4d74043d83328a4a70 Mon Sep 17 00:00:00 2001 From: IAmBigCoat Date: Sat, 5 Dec 2015 21:43:20 -0500 Subject: [PATCH] Fixed num2hex for large numbers. ID numbers are larger than the bitwise operators allow, which gave everyone one of about sixteen ID #s. Not sure what or if this actually fixes anything mechanically, but ID #s are pretty again. --- code/__HELPERS/type2type.dm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 311ef87f57d..2421c64b62f 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -50,16 +50,14 @@ var/hex = "" while(num) - var/val = num & 15 - num >>= 4 + var/val = num % 16 + num = round(num / 16) if(val > 9) val = ascii2text(55 + val) // 65 - 70 correspond to "A" - "F" hex = "[val][hex]" - while(length(hex) < placeholder) hex = "0[hex]" - return hex || "0" // Concatenates a list of strings into a single string. A seperator may optionally be provided.