From 47ed505fae5f064928bafdcbf9d7af9cc9da70e8 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sun, 11 Jun 2023 17:29:25 -0500 Subject: [PATCH] use fs_homepath as default integration bus dir --- GameFiles/GameInterface/_integration_iw4x.gsc | 2 ++ .../GameInterface/_integration_shared.gsc | 2 +- .../_integration_t6_file_bus.gsc | 20 +++++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/GameFiles/GameInterface/_integration_iw4x.gsc b/GameFiles/GameInterface/_integration_iw4x.gsc index 9a717d0eb..33877822b 100644 --- a/GameFiles/GameInterface/_integration_iw4x.gsc +++ b/GameFiles/GameInterface/_integration_iw4x.gsc @@ -37,6 +37,8 @@ Setup() RegisterClientCommands(); level notify( level.notifyTypes.gameFunctionsInitialized ); + + scripts\_integration_base::_SetDvarIfUninitialized( level.commonKeys.busdir, GetDvar( "fs_homepath" ) + "userraw/" + "scriptdata" ); if ( GetDvarInt( level.commonKeys.enabled ) != 1 ) { diff --git a/GameFiles/GameInterface/_integration_shared.gsc b/GameFiles/GameInterface/_integration_shared.gsc index fc2b30073..31474ff93 100644 --- a/GameFiles/GameInterface/_integration_shared.gsc +++ b/GameFiles/GameInterface/_integration_shared.gsc @@ -212,7 +212,7 @@ OnBusModeRequestedCallback( event ) scripts\_integration_base::LogDebug( "Bus mode updated" ); - if ( GetDvar( level.commonKeys.busMode ) == "file" || GetDvar( level.commonKeys.busDir ) != "" ) + if ( GetDvar( level.commonKeys.busMode ) == "file" && GetDvar( level.commonKeys.busDir ) != "" ) { level.busMethods[level.commonFunctions.getInboundData] = level.overrideMethods[level.commonFunctions.getInboundData]; level.busMethods[level.commonFunctions.getOutboundData] = level.overrideMethods[level.commonFunctions.getOutboundData]; diff --git a/GameFiles/GameInterface/_integration_t6_file_bus.gsc b/GameFiles/GameInterface/_integration_t6_file_bus.gsc index bf3a9a1d2..d9b850d74 100644 --- a/GameFiles/GameInterface/_integration_t6_file_bus.gsc +++ b/GameFiles/GameInterface/_integration_t6_file_bus.gsc @@ -49,25 +49,25 @@ Setup() level.overrideMethods[level.commonFunctions.getOutboundData] = ::GetOutboundData; level.overrideMethods[level.commonFunctions.setInboundData] = ::SetInboundData; level.overrideMethods[level.commonFunctions.setOutboundData] = ::SetOutboundData; - scripts\_integration_base::_SetDvarIfUninitialized( level.commonKeys.busdir, GetDvar("fs_homepath") ); + scripts\_integration_base::_SetDvarIfUninitialized( level.commonKeys.busdir, GetDvar( "fs_homepath" ) ); } -GetInboundData(location) -{ - return readFile( location); -} - -GetOutboundData(location) +GetInboundData( location ) { return readFile( location ); } -SetInboundData(location, data ) +GetOutboundData( location ) +{ + return readFile( location ); +} + +SetInboundData( location, data ) { writeFile( location, data ); } -SetOutboundData(location, data ) +SetOutboundData( location, data ) { - writeFile(location, data ); + writeFile( location, data ); }