diff --git a/binaries/data/mods/public/globalscripts/random.js b/binaries/data/mods/public/globalscripts/random.js
index a581f13fb5..24398f2470 100644
a
|
b
|
|
| 1 | var oldrandom = Math.random; |
| 2 | |
| 3 | Math.random = () => { |
| 4 | warn(new Error().stack); |
| 5 | return Math.random2 ? Math.random2() : oldrandom(); |
| 6 | }; |
1 | 7 | /** |
2 | 8 | * Returns a pair of independent and normally distributed (zero mean, variance 1) random numbers. |
3 | 9 | * Uses the Polar-Rejection method. |
diff --git a/binaries/data/mods/public/simulation/templates/units/rome/support_female_citizen.xml b/binaries/data/mods/public/simulation/templates/units/rome/support_female_citizen.xml
index 3b1c326a43..a2d3317af1 100644
a
|
b
|
|
4 | 4 | <Entities datatype="tokens"> |
5 | 5 | structures/rome/army_camp |
6 | 6 | structures/rome/temple_vesta |
| 7 | units/rome/support_female_citizen |
7 | 8 | </Entities> |
8 | 9 | </Builder> |
| 10 | <BuildRestrictions> |
| 11 | <PlacementType>land</PlacementType> |
| 12 | <Territory>own</Territory> |
| 13 | <Category>Structure</Category> |
| 14 | </BuildRestrictions> |
9 | 15 | <Identity> |
10 | 16 | <Civ>rome</Civ> |
11 | 17 | <Lang>latin</Lang> |
diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp
index e4057ac6a9..0f68d43504 100644
a
|
b
|
bool ScriptInterface::MathRandom(double& nbr) const
|
286 | 286 | if (m->m_rng == nullptr) |
287 | 287 | return false; |
288 | 288 | nbr = generate_uniform_real(*(m->m_rng), 0.0, 1.0); |
| 289 | debug_printf("RANDOM %f\n", nbr); |
289 | 290 | return true; |
290 | 291 | } |
291 | 292 | |
… |
… |
bool ScriptInterface::ReplaceNondeterministicRNG(boost::rand48& rng)
|
442 | 443 | if (JS_GetProperty(rq.cx, global, "Math", &math) && math.isObject()) |
443 | 444 | { |
444 | 445 | JS::RootedObject mathObj(rq.cx, &math.toObject()); |
445 | | JS::RootedFunction random(rq.cx, JS_DefineFunction(rq.cx, mathObj, "random", Math_random, 0, |
| 446 | JS::RootedFunction random(rq.cx, JS_DefineFunction(rq.cx, mathObj, "random2", Math_random, 0, |
446 | 447 | JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT)); |
447 | 448 | if (random) |
448 | 449 | { |
diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp
index 3f15d08522..e744e2c596 100644
a
|
b
|
void CComponentManager::InitSystemEntity()
|
830 | 830 | |
831 | 831 | entity_id_t CComponentManager::AddEntity(const std::wstring& templateName, entity_id_t ent) |
832 | 832 | { |
| 833 | LOGWARNING("AddEntity %d\n", ent); |
| 834 | |
833 | 835 | ICmpTemplateManager *cmpTemplateManager = static_cast<ICmpTemplateManager*> (QueryInterface(SYSTEM_ENTITY, IID_TemplateManager)); |
834 | 836 | if (!cmpTemplateManager) |
835 | 837 | { |