From 6c05f1daf09444ed62264f215bde9515ac29f080 Mon Sep 17 00:00:00 2001
From: biwa <foracc@d00m.info>
Date: Fri, 1 Nov 2019 00:21:02 +0100
Subject: [PATCH] - Fixed a problem in the 3D floor mode plugin that caused an
 exception when saving the program preferences. Fixes #310.

---
 Source/Plugins/3DFloorMode/Interface/PreferencesForm.cs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Source/Plugins/3DFloorMode/Interface/PreferencesForm.cs b/Source/Plugins/3DFloorMode/Interface/PreferencesForm.cs
index 28843c84..dd44d781 100644
--- a/Source/Plugins/3DFloorMode/Interface/PreferencesForm.cs
+++ b/Source/Plugins/3DFloorMode/Interface/PreferencesForm.cs
@@ -5,6 +5,7 @@ using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
+using System.Runtime.CompilerServices;
 using System.Windows.Forms;
 using CodeImp.DoomBuilder.Windows;
 
@@ -23,6 +24,9 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
 		#region ================== Methods
 
 		// When OK is pressed on the preferences dialog
+		// Prevent inlining, otherwise there are unexpected interactions with Assembly.GetCallingAssembly
+		// See https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getcallingassembly?view=netframework-4.6.1#remarks
+		[MethodImplAttribute(MethodImplOptions.NoInlining)]
 		public void OnAccept(PreferencesController controller)
 		{
 			// Write preferred settings