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

@@ -14,7 +14,7 @@ using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using OpenRA.Primitives;
using OpenRA.Traits;
@@ -70,7 +70,7 @@ namespace OpenRA
if (type == null)
throw new InvalidDataException($"Unknown initializer type '{initInstance[0]}Init'");
var init = (ActorInit)FormatterServices.GetUninitializedObject(type);
var init = (ActorInit)RuntimeHelpers.GetUninitializedObject(type);
if (initInstance.Length > 1)
type.GetField(nameof(ActorInit.InstanceName)).SetValue(init, initInstance[1]);