Upgrade to .NET 8.0 and remove/migrate obsolete stuff

This commit is contained in:
michaeldgg2
2024-09-13 23:01:58 +02:00
committed by Paul Chote
parent 2a3ef8f910
commit 81aa068b15
15 changed files with 27 additions and 47 deletions

View File

@@ -13,7 +13,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using Eluant;
using OpenRA.Mods.Common.Traits;
using OpenRA.Primitives;
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Scripting
throw new LuaException($"Unknown initializer type '{initInstance[0]}'");
// Construct the ActorInit.
var init = (ActorInit)FormatterServices.GetUninitializedObject(initType);
var init = (ActorInit)RuntimeHelpers.GetUninitializedObject(initType);
if (initInstance.Length > 1)
initType.GetField(nameof(ActorInit.InstanceName)).SetValue(init, initInstance[1]);