From cc0224cb87f8e95ca20ff836c34e777ddfebebce Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 24 Feb 2024 13:41:55 +0500 Subject: [PATCH 1/2] Add "minus" into regexp. --- CMakeLists.txt | 4 ++-- wscript | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84897728..147615a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,12 +89,12 @@ endif() # MAIN BUILD CODE \ ###################\ -file(STRINGS "mod_options.txt" MOD_OPTIONS_STRINGS REGEX "^([A-Za-z0-9_]+)=([A-Za-z0-9_]+)\ \#\ (.*)$") +file(STRINGS "mod_options.txt" MOD_OPTIONS_STRINGS REGEX "^([A-Za-z0-9_-]+)=([A-Za-z0-9_-]+)\ \#\ (.*)$") foreach(LINE IN LISTS MOD_OPTIONS_STRINGS) # file() itself doesn't populate CMAKE_MATCH_, so # reparse the string - if(${LINE} MATCHES "^([A-Za-z0-9_]+)=([A-Za-z0-9_]+)\ \#\ (.*)$") + if(${LINE} MATCHES "^([A-Za-z0-9_-]+)=([A-Za-z0-9_-]+)\ \#\ (.*)$") # detect boolean options if(${CMAKE_MATCH_2} STREQUAL "ON" OR ${CMAKE_MATCH_2} STREQUAL "OFF") option(${CMAKE_MATCH_1} "${CMAKE_MATCH_3}" ${CMAKE_MATCH_2}) diff --git a/wscript b/wscript index 4e5503ed..6163e793 100644 --- a/wscript +++ b/wscript @@ -210,7 +210,7 @@ def configure(conf): conf.define('LINUX', True) conf.msg(msg='-> processing mod options', result='...', color='BLUE') - regex = re.compile('^([A-Za-z0-9_]+)=([A-Za-z0-9_]+)\ \#\ (.*)$') + regex = re.compile('^([A-Za-z0-9_-]+)=([A-Za-z0-9_-]+)\ \#\ (.*)$') with open(str(conf.path.make_node('mod_options.txt'))) as fd: lines = fd.readlines() for line in lines: From 19f3e9197854f4bfbd3cf63bcead19439275f926 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:50:59 +0500 Subject: [PATCH 2/2] Prevent crash on 64-bit archs. --- dlls/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/util.cpp b/dlls/util.cpp index ac6e28f8..9834aa1f 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -2217,7 +2217,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou break; case FIELD_EHANDLE: // Input and Output sizes are different! - pInputData = (char*)pData + j * gSizes[pTest->fieldType]; + pInputData = (char*)pData + j * gInputSizes[pTest->fieldType]; entityIndex = *(int *)pInputData; pent = EntityFromIndex( entityIndex ); if( pent )