16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 13:39:18 +02:00

ai order list size increase, random overcast value, minor bug fixes

This commit is contained in:
tmj-fstate
2018-10-02 22:38:01 +02:00
parent 913541bbee
commit 044e3c921a
3 changed files with 16 additions and 8 deletions

View File

@@ -162,7 +162,15 @@ state_serializer::deserialize_atmo( cParser &Input, scene::scratch_data &Scratch
std::string token { Input.getToken<std::string>() };
if( token != "endatmo" ) {
// optional overcast parameter
Global.Overcast = clamp( std::stof( token ), 0.f, 2.f );
Global.Overcast = std::stof( token );
if( Global.Overcast < 0.f ) {
// negative overcast means random value in range 0-abs(specified range)
Global.Overcast =
Random(
clamp(
std::abs( Global.Overcast ),
0.f, 2.f ) );
}
// overcast drives weather so do a calculation here
// NOTE: ugly, clean it up when we're done with world refactoring
simulation::Environment.compute_weather();