mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-29 13:12:07 +00:00
Fix all broken checks for the absent (random-mapgen+simulation) Seed property in the engine, refs #3965.
Hence display the originally intended useful warnings (instead of the characterless JS "Script value conversion check failed" warning and skipping the intended warnings). This was SVN commit r19718.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2016 Wildfire Games.
|
||||
/* Copyright (C) 2017 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -794,7 +794,8 @@ void CSimulation2::SetMapSettings(JS::HandleValue settings)
|
||||
m->m_MapSettings = settings;
|
||||
|
||||
u32 seed = 0;
|
||||
if (!m->m_ComponentManager.GetScriptInterface().GetProperty(m->m_MapSettings, "Seed", seed))
|
||||
if (!m->m_ComponentManager.GetScriptInterface().HasProperty(m->m_MapSettings, "Seed") ||
|
||||
!m->m_ComponentManager.GetScriptInterface().GetProperty(m->m_MapSettings, "Seed", seed))
|
||||
LOGWARNING("CSimulation2::SetInitAttributes: No seed value specified - using %d", seed);
|
||||
|
||||
m->m_ComponentManager.SetRNGSeed(seed);
|
||||
|
||||
Reference in New Issue
Block a user