diff --git a/SoundFilter/Filter.cs b/SoundFilter/Filter.cs index dab1382..80107ad 100755 --- a/SoundFilter/Filter.cs +++ b/SoundFilter/Filter.cs @@ -121,9 +121,9 @@ namespace SoundFilter { // write a pointer to the empty scd Marshal.WriteIntPtr(infoPtr + 8, noSoundPtr); // specify where the game should offset from for the sound index - Marshal.WriteInt32(infoPtr + 0x90, 0x54); + Marshal.WriteInt32(infoPtr + 0x88, 0x54); // specify the number of sounds in the file - Marshal.WriteInt16(infoPtr + 0x9C, 0); + Marshal.WriteInt16(infoPtr + 0x94, 0); return (noSoundPtr, infoPtr); } @@ -175,6 +175,7 @@ namespace SoundFilter { var shouldFilter = this.PlaySpecificSoundDetourInner(a1, idx); if (shouldFilter) { a1 = (long) this.InfoPtr; + idx = 0; } } catch (Exception ex) { PluginLog.LogError(ex, "Error in PlaySpecificSoundDetour"); diff --git a/SoundFilter/SoundFilter.csproj b/SoundFilter/SoundFilter.csproj index 345730d..8522d94 100755 --- a/SoundFilter/SoundFilter.csproj +++ b/SoundFilter/SoundFilter.csproj @@ -57,9 +57,9 @@ - - - + + + diff --git a/SoundFilter/Ui/Settings.cs b/SoundFilter/Ui/Settings.cs index 9c45212..8be6156 100755 --- a/SoundFilter/Ui/Settings.cs +++ b/SoundFilter/Ui/Settings.cs @@ -136,6 +136,7 @@ namespace SoundFilter.Ui { if (drag != null && drag.Value.dst < this.Plugin.Config.Filters.Count && drag.Value.dst >= 0) { this._dragging = drag.Value.dst; + // ReSharper disable once SwapViaDeconstruction var temp = this.Plugin.Config.Filters[drag.Value.src]; this.Plugin.Config.Filters[drag.Value.src] = this.Plugin.Config.Filters[drag.Value.dst]; this.Plugin.Config.Filters[drag.Value.dst] = temp;