From bfe4a7b08e381c142f67bc73cbe4dab6edc27acc Mon Sep 17 00:00:00 2001 From: Wanne Date: Fri, 6 Apr 2012 07:46:47 +0000 Subject: [PATCH] - Fixed issue with pointer arithmetic and wchar_t in method "PolulateSectionFromCommandLine()" (by tazpn) o Now this working method is enabled again in the source git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5164 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Standard Gaming Platform/sgp.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Standard Gaming Platform/sgp.cpp b/Standard Gaming Platform/sgp.cpp index 8e865312..82805ab5 100644 --- a/Standard Gaming Platform/sgp.cpp +++ b/Standard Gaming Platform/sgp.cpp @@ -1397,9 +1397,7 @@ void GetRuntimeSettings( ) #else vfs::PropertyContainer oProps; oProps.initFromIniFile(GAME_INI_FILE); - - // WANNE: @tazpn: Disabled the method, because when I run a debug version directly from any VS (by pressing F5) the game crashes in the method. - //PopulateSectionFromCommandLine(oProps, "Ja2 Settings"); + PopulateSectionFromCommandLine(oProps, "Ja2 Settings"); #endif #ifndef USE_VFS @@ -1835,7 +1833,7 @@ static void PopulateSectionFromCommandLine(vfs::PropertyContainer &oProps, vfs:: int argc = 0, nchars = 0; ParseCommandLine( lpCommandLine, NULL, NULL, &argc, &nchars); wchar_t **argv = (wchar_t **)_alloca(argc * sizeof(wchar_t *) + nchars * sizeof(wchar_t)); - ParseCommandLine( lpCommandLine, argv, ((wchar_t*)argv) + argc * sizeof(wchar_t*), &argc, &nchars); + ParseCommandLine( lpCommandLine, argv, (wchar_t *)(((char*)argv) + argc * sizeof(wchar_t*)), &argc, &nchars); for (int i = 1; i < argc; i++) {