mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-12 23:07:55 +03:00
Merge pull request #274 from Blixibon/mapbase/feature/dot-slash-command-line-param
Command line parameter to support dot slashes in VScript file read calls
This commit is contained in:
commit
11533fa292
@ -22,6 +22,7 @@
|
|||||||
#include "filesystem.h"
|
#include "filesystem.h"
|
||||||
#include "igameevents.h"
|
#include "igameevents.h"
|
||||||
#include "engine/ivdebugoverlay.h"
|
#include "engine/ivdebugoverlay.h"
|
||||||
|
#include "icommandline.h"
|
||||||
|
|
||||||
#ifdef CLIENT_DLL
|
#ifdef CLIENT_DLL
|
||||||
#include "IEffects.h"
|
#include "IEffects.h"
|
||||||
@ -1094,7 +1095,7 @@ const char *CScriptReadWriteFile::FileRead( const char *szFile )
|
|||||||
char pszFullName[MAX_PATH];
|
char pszFullName[MAX_PATH];
|
||||||
V_snprintf( pszFullName, sizeof(pszFullName), SCRIPT_RW_FULL_PATH_FMT, szFile );
|
V_snprintf( pszFullName, sizeof(pszFullName), SCRIPT_RW_FULL_PATH_FMT, szFile );
|
||||||
|
|
||||||
if ( !V_RemoveDotSlashes( pszFullName, CORRECT_PATH_SEPARATOR, true ) )
|
if ( !CommandLine()->FindParm( "-script_dotslash_read" ) && !V_RemoveDotSlashes( pszFullName, CORRECT_PATH_SEPARATOR, true ) )
|
||||||
{
|
{
|
||||||
DevWarning( 2, "Invalid file location : %s\n", szFile );
|
DevWarning( 2, "Invalid file location : %s\n", szFile );
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1143,7 +1144,7 @@ bool CScriptReadWriteFile::FileExists( const char *szFile )
|
|||||||
char pszFullName[MAX_PATH];
|
char pszFullName[MAX_PATH];
|
||||||
V_snprintf( pszFullName, sizeof(pszFullName), SCRIPT_RW_FULL_PATH_FMT, szFile );
|
V_snprintf( pszFullName, sizeof(pszFullName), SCRIPT_RW_FULL_PATH_FMT, szFile );
|
||||||
|
|
||||||
if ( !V_RemoveDotSlashes( pszFullName, CORRECT_PATH_SEPARATOR, true ) )
|
if ( !CommandLine()->FindParm( "-script_dotslash_read" ) && !V_RemoveDotSlashes( pszFullName, CORRECT_PATH_SEPARATOR, true ) )
|
||||||
{
|
{
|
||||||
DevWarning( 2, "Invalid file location : %s\n", szFile );
|
DevWarning( 2, "Invalid file location : %s\n", szFile );
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1224,7 +1225,7 @@ HSCRIPT CScriptReadWriteFile::KeyValuesRead( const char *szFile )
|
|||||||
char pszFullName[MAX_PATH];
|
char pszFullName[MAX_PATH];
|
||||||
V_snprintf( pszFullName, sizeof(pszFullName), SCRIPT_RW_FULL_PATH_FMT, szFile );
|
V_snprintf( pszFullName, sizeof(pszFullName), SCRIPT_RW_FULL_PATH_FMT, szFile );
|
||||||
|
|
||||||
if ( !V_RemoveDotSlashes( pszFullName, CORRECT_PATH_SEPARATOR, true ) )
|
if ( !CommandLine()->FindParm( "-script_dotslash_read" ) && !V_RemoveDotSlashes( pszFullName, CORRECT_PATH_SEPARATOR, true ) )
|
||||||
{
|
{
|
||||||
DevWarning( 2, "Invalid file location : %s\n", szFile );
|
DevWarning( 2, "Invalid file location : %s\n", szFile );
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user