From bba7528c763e1bbb92266c7343d42121cca8988a Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:07:38 +0300 Subject: [PATCH] Remove HandleLimitedNumExecutions() Not called anywhere in the code. Plus, if we limit the amount of time 1.13 can be played to 10 starts, we'll have at least 5 angry players --- Utils/Utilities.cpp | 58 --------------------------------------------- Utils/Utilities.h | 1 - 2 files changed, 59 deletions(-) diff --git a/Utils/Utilities.cpp b/Utils/Utilities.cpp index 4558afdab..6fee0a973 100644 --- a/Utils/Utilities.cpp +++ b/Utils/Utilities.cpp @@ -294,64 +294,6 @@ BOOLEAN IfWin95(void) } -void HandleLimitedNumExecutions( ) -{ - // Get system directory - HWFILE hFileHandle; - CHAR8 ubSysDir[ 512 ]; - INT8 bNumRuns; - - GetSystemDirectory( (LPSTR) ubSysDir, sizeof( ubSysDir ) ); - - // Append filename - strcat( ubSysDir, "\\winaese.dll" ); - - // Open file and check # runs... - if ( FileExists( (STR)ubSysDir ) ) - { - // Open and read - if ( ( hFileHandle = FileOpen( (STR)ubSysDir, FILE_ACCESS_READ, FALSE)) == 0) - { - return; - } - - // Read value - FileRead( hFileHandle, &bNumRuns, sizeof( bNumRuns ) , NULL); - - // Close file - FileClose( hFileHandle ); - - if ( bNumRuns <= 0 ) - { - // Fail! - SET_ERROR( "Error 1054: Cannot execute - contact Sir-Tech Software." ); - return; - } - - } - else - { - bNumRuns = 10; - } - - // OK, decrement # runs... - bNumRuns--; - - // Open and write - if ( ( hFileHandle = FileOpen( (STR)ubSysDir, FILE_ACCESS_WRITE, FALSE)) == 0) - { - return; - } - - // Write value - FileWrite( hFileHandle, &bNumRuns, sizeof( bNumRuns ) , NULL); - - // Close file - FileClose( hFileHandle ); - -} - - SGPFILENAME gCheckFilenames[] = { "DATA\\INTRO.SLF", diff --git a/Utils/Utilities.h b/Utils/Utilities.h index 5d1387665..cc89598f8 100644 --- a/Utils/Utilities.h +++ b/Utils/Utilities.h @@ -20,7 +20,6 @@ BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont ); BOOLEAN IfWinNT(void); BOOLEAN IfWin95(void); -void HandleLimitedNumExecutions( ); // WANNE: This method replaces characters in a given text with new characters STR8 Replace(STR8 string, STR8 oldpiece, STR8 newpiece);