diff --git a/source/network/NetTurnManager.cpp b/source/network/NetTurnManager.cpp index 9cbcf4b179..60eade6f33 100644 --- a/source/network/NetTurnManager.cpp +++ b/source/network/NetTurnManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2016 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -298,6 +298,7 @@ void CNetTurnManager::AddCommand(int client, int player, JS::HandleValue data, u return; } + m_Simulation2.GetScriptInterface().FreezeObject(data, true); m_QueuedCommands[turn - (m_CurrentTurn+1)][client].emplace_back(player, m_Simulation2.GetScriptInterface().GetContext(), data); } diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp index 9ce2138135..18618f73b3 100644 --- a/source/simulation2/Simulation2.cpp +++ b/source/simulation2/Simulation2.cpp @@ -164,6 +164,7 @@ public: JSContext* cxNew = newScript.GetContext(); JSAutoRequest rqNew(cxNew); JS::RootedValue tmpCommand(cxNew, newScript.CloneValueFromOtherContext(oldScript, command.data)); + newScript.FreezeObject(tmpCommand, true); SimulationCommand cmd(command.player, cxNew, tmpCommand); newCommands.emplace_back(std::move(cmd)); }