diff --git a/src/rwbase.h b/src/rwbase.h index e0ae935..5d13354 100644 --- a/src/rwbase.h +++ b/src/rwbase.h @@ -150,22 +150,18 @@ extern char *debugFile; inline uint32 libraryIDPack(int version, int build) { - // TODO: check version in if statement - if(build){ - version -= 0x30000; - return (version&0xFFC0) << 14 | (version&0x3F) << 16 | - (build & 0xFFFF); - } - return version>>8; + if(version < 0x32000) + return version>>8; + return (version-0x30000 & 0x3FF00) << 14 | (version&0x3F) << 16 | + (build & 0xFFFF); } inline int libraryIDUnpackVersion(uint32 libid) { if(libid & 0xFFFF0000) - return (libid>>14 & 0x3FF00) | - (libid>>16 & 0x3F) | - 0x30000; + return (libid>>14 & 0x3FF00) + 0x30000 | + (libid>>16 & 0x3F); else return libid<<8; }