From 966b759efcc92939cae114f62e2c3ee0dee7b1ff Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Thu, 18 Jul 2024 22:09:30 +0800 Subject: [PATCH] [saco] Implement/match `IsHexChar(...)` --- saco/game/util.cpp | 10 ++++++++++ saco/game/util.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/saco/game/util.cpp b/saco/game/util.cpp index 88db767..33f08b1 100644 --- a/saco/game/util.cpp +++ b/saco/game/util.cpp @@ -1849,6 +1849,16 @@ BOOL IsFileOrDirectoryExists(char * szPath) //---------------------------------------------------- +BOOL IsHexChar(char c) +{ + return c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f'; +} + +BOOL IsHexChar(wchar_t c) +{ + return c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f'; +} + DWORD unnamed_100B6100(char *szString, int nMaxLen) { char tmp_buf[2049]; diff --git a/saco/game/util.h b/saco/game/util.h index fef065d..bfd37b9 100644 --- a/saco/game/util.h +++ b/saco/game/util.h @@ -64,3 +64,6 @@ int GetInvalidModelInfoCount(); bool HasCollisionLoaded(VECTOR *vec); BOOL __stdcall IsATrainPart(ENTITY_TYPE *pEntity); + +BOOL IsHexChar(char c); +BOOL IsHexChar(wchar_t c);