aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobTheBob <for.oliver.kirkham@gmail.com>2023-03-07 14:56:12 +0000
committerBobTheBob <for.oliver.kirkham@gmail.com>2023-03-07 14:56:12 +0000
commitc6fdbc83b74a57bac91372f028f2dd9b8b74ffd6 (patch)
tree8942f0e855495509c4aecb97f2fdb016277fdab1
parent2a20e0088ee4c05edd0b52d213272504e7d4c94e (diff)
downloadNorthstarLauncher-c6fdbc83b74a57bac91372f028f2dd9b8b74ffd6.tar.gz
NorthstarLauncher-c6fdbc83b74a57bac91372f028f2dd9b8b74ffd6.zip
reload turret settings
-rw-r--r--NorthstarDLL/NorthstarDLL.vcxproj1
-rw-r--r--NorthstarDLL/NorthstarDLL.vcxproj.filters3
-rw-r--r--NorthstarDLL/client/audio.cpp2
-rw-r--r--NorthstarDLL/mods/modmanager.cpp3
-rw-r--r--NorthstarDLL/mods/modmanager.h1
-rw-r--r--NorthstarDLL/reloadturrets.cpp11
6 files changed, 21 insertions, 0 deletions
diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj
index 3ed99d25..e26f5762 100644
--- a/NorthstarDLL/NorthstarDLL.vcxproj
+++ b/NorthstarDLL/NorthstarDLL.vcxproj
@@ -509,6 +509,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="plugins\plugins.cpp" />
+ <ClCompile Include="reloadturrets.cpp" />
<ClCompile Include="scripts\client\clientchathooks.cpp" />
<ClCompile Include="scripts\client\cursorposition.cpp" />
<ClCompile Include="scripts\client\scriptbrowserhooks.cpp" />
diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters
index 10f6d796..44687ba6 100644
--- a/NorthstarDLL/NorthstarDLL.vcxproj.filters
+++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters
@@ -1441,6 +1441,9 @@
<ClCompile Include="mods\reload\reloadmodweapons_misc.cpp">
<Filter>Source Files\mods\reload</Filter>
</ClCompile>
+ <ClCompile Include="reloadturrets.cpp">
+ <Filter>Source Files\mods\reload</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<MASM Include="audio_asm.asm">
diff --git a/NorthstarDLL/client/audio.cpp b/NorthstarDLL/client/audio.cpp
index ea1f6416..39327900 100644
--- a/NorthstarDLL/client/audio.cpp
+++ b/NorthstarDLL/client/audio.cpp
@@ -264,6 +264,8 @@ EventOverrideData::EventOverrideData(const std::string& data, const fs::path& pa
bool CustomAudioManager::TryLoadAudioOverride(const fs::path& defPath)
{
+ return true;
+
if (IsDedicatedServer())
return true; // silently fail
diff --git a/NorthstarDLL/mods/modmanager.cpp b/NorthstarDLL/mods/modmanager.cpp
index 6d36a975..0af73e04 100644
--- a/NorthstarDLL/mods/modmanager.cpp
+++ b/NorthstarDLL/mods/modmanager.cpp
@@ -1040,6 +1040,8 @@ void ModManager::ReloadNecessaryModAssets(bool bDeferred, const ModAssetsToReloa
DeferredReloadWeaponSprings();
DeferredReloadWeapons(pAssetsToReload->setsWeaponSettings);
+
+ // player/ai/turret settings and aibehaviors automatically reload themselves on level change already, don't need to reload here
}
else
{
@@ -1057,6 +1059,7 @@ void ModManager::ReloadNecessaryModAssets(bool bDeferred, const ModAssetsToReloa
TryImmediateReloadWeapons(pAssetsToReload->setsWeaponSettings);
+ // TODO player/ai/turret settings and aibehavior
// need to reimplement mat_reloadmaterials for this
// if (m_AssetTypesToReload.bMaterials)
diff --git a/NorthstarDLL/mods/modmanager.h b/NorthstarDLL/mods/modmanager.h
index 9eccffc5..3002a099 100644
--- a/NorthstarDLL/mods/modmanager.h
+++ b/NorthstarDLL/mods/modmanager.h
@@ -153,6 +153,7 @@ class ModManager
bool bMaterials = false; // vmts
bool bPlayerSettings = false;
bool bAiSettings = false;
+ bool bTurretSettings = false;
bool bDamageDefs = false; // damagedefs
bool bWeaponSprings = false;
bool bAmmoSuckBehaviours = false;
diff --git a/NorthstarDLL/reloadturrets.cpp b/NorthstarDLL/reloadturrets.cpp
new file mode 100644
index 00000000..611f8ae3
--- /dev/null
+++ b/NorthstarDLL/reloadturrets.cpp
@@ -0,0 +1,11 @@
+ON_DLL_LOAD_CLIENT("client.dll", ClientModReloadTurretSettings, (CModule module))
+{
+ // always reload turret settings on level load (ai and player settings do this already)
+ module.Offset(0x584B85).Patch("EB"); // jle => jmp
+}
+
+ON_DLL_LOAD_CLIENT("server.dll", ServerModReloadTurretSettings, (CModule module))
+{
+ // always reload turret settings on level load (ai and player settings do this already)
+ module.Offset(0x667115).Patch("EB"); // jle => jmp
+}