Skip to content

Commit 2a15c44

Browse files
committed
Merge pull request OpenRA#6736 from pchote/fix-player-binding
Don’t regenerate the Lua player bindings each query.
2 parents fad0215 + 19760b4 commit 2a15c44

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

OpenRA.Game/Player.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ public bool IsAlliedWith(Player p)
116116
Lazy<ScriptPlayerInterface> luaInterface;
117117
public void OnScriptBind(ScriptContext context)
118118
{
119-
luaInterface = Exts.Lazy(() => new ScriptPlayerInterface(context, this));
119+
if (luaInterface == null)
120+
luaInterface = Exts.Lazy(() => new ScriptPlayerInterface(context, this));
120121
}
121122

122123
public LuaValue this[LuaRuntime runtime, LuaValue keyValue]

0 commit comments

Comments
 (0)