ScriptActorInterfaces, unbind on actor destroy.

This commit is contained in:
Vapre
2022-07-26 08:00:00 +02:00
committed by Matthias Mailänder
parent fc1d8d2355
commit 215898c7ec
5 changed files with 63 additions and 54 deletions

View File

@@ -9,9 +9,6 @@
*/
#endregion
using System;
using System.Linq;
namespace OpenRA.Scripting
{
public class ScriptPlayerInterface : ScriptObjectWrapper
@@ -25,15 +22,7 @@ namespace OpenRA.Scripting
: base(context)
{
this.player = player;
var args = new object[] { context, player };
var objects = context.PlayerCommands.Select(cg =>
{
var groupCtor = cg.GetConstructor(new Type[] { typeof(ScriptContext), typeof(Player) });
return groupCtor.Invoke(args);
});
Bind(objects);
Bind(CreateObjects(context.PlayerCommands, new object[] { context, player }));
}
}
}