Deep freeze simulation commands to prevent accidental updates. Fixes #3647.
This was SVN commit r17673.
This commit is contained in:
parent
e035e3e985
commit
f34dc412b6
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2015 Wildfire Games.
|
/* Copyright (C) 2016 Wildfire Games.
|
||||||
* This file is part of 0 A.D.
|
* This file is part of 0 A.D.
|
||||||
*
|
*
|
||||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
* 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_Simulation2.GetScriptInterface().FreezeObject(data, true);
|
||||||
m_QueuedCommands[turn - (m_CurrentTurn+1)][client].emplace_back(player, m_Simulation2.GetScriptInterface().GetContext(), data);
|
m_QueuedCommands[turn - (m_CurrentTurn+1)][client].emplace_back(player, m_Simulation2.GetScriptInterface().GetContext(), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,6 +164,7 @@ public:
|
|||||||
JSContext* cxNew = newScript.GetContext();
|
JSContext* cxNew = newScript.GetContext();
|
||||||
JSAutoRequest rqNew(cxNew);
|
JSAutoRequest rqNew(cxNew);
|
||||||
JS::RootedValue tmpCommand(cxNew, newScript.CloneValueFromOtherContext(oldScript, command.data));
|
JS::RootedValue tmpCommand(cxNew, newScript.CloneValueFromOtherContext(oldScript, command.data));
|
||||||
|
newScript.FreezeObject(tmpCommand, true);
|
||||||
SimulationCommand cmd(command.player, cxNew, tmpCommand);
|
SimulationCommand cmd(command.player, cxNew, tmpCommand);
|
||||||
newCommands.emplace_back(std::move(cmd));
|
newCommands.emplace_back(std::move(cmd));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user