diff options
author | aap <aap@papnet.eu> | 2019-06-01 19:18:19 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-06-01 19:18:19 +0200 |
commit | c40c7acb96a926378df7d7b43920966ab31ff95e (patch) | |
tree | a524403990b5c17a1c0b97275c773a26a8c98fb2 /src/Zones.cpp | |
parent | more RW lights (diff) | |
download | re3-c40c7acb96a926378df7d7b43920966ab31ff95e.tar re3-c40c7acb96a926378df7d7b43920966ab31ff95e.tar.gz re3-c40c7acb96a926378df7d7b43920966ab31ff95e.tar.bz2 re3-c40c7acb96a926378df7d7b43920966ab31ff95e.tar.lz re3-c40c7acb96a926378df7d7b43920966ab31ff95e.tar.xz re3-c40c7acb96a926378df7d7b43920966ab31ff95e.tar.zst re3-c40c7acb96a926378df7d7b43920966ab31ff95e.zip |
Diffstat (limited to 'src/Zones.cpp')
-rw-r--r-- | src/Zones.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Zones.cpp b/src/Zones.cpp index 6caffde2..9b40db0f 100644 --- a/src/Zones.cpp +++ b/src/Zones.cpp @@ -360,9 +360,11 @@ CTheZones::GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info) else{ if(CClock::GetIsTimeInRange(19, 22)){ n = (CClock::GetHours() - 19) / 3.0f; + assert(n >= 0.0f && n <= 1.0f); d = n - 1.0f; }else{ d = (CClock::GetHours() - 5) / 3.0f; + assert(d >= 0.0f && d <= 1.0f); n = d - 1.0f; } info->carDensity = day->carDensity * d + night->carDensity * n; @@ -399,6 +401,24 @@ CTheZones::GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info) info->pedGroup = day->pedGroup; else info->pedGroup = night->pedGroup; + + assert(info->carDensity >= 0); + assert(info->carThreshold[0] >= 0); + assert(info->carThreshold[1] >= 0); + assert(info->carThreshold[2] >= 0); + assert(info->carThreshold[3] >= 0); + assert(info->carThreshold[4] >= 0); + assert(info->carThreshold[5] >= 0); + assert(info->copThreshold >= 0); + assert(info->gangThreshold[0] >= 0); + assert(info->gangThreshold[1] >= 0); + assert(info->gangThreshold[2] >= 0); + assert(info->gangThreshold[3] >= 0); + assert(info->gangThreshold[4] >= 0); + assert(info->gangThreshold[5] >= 0); + assert(info->gangThreshold[6] >= 0); + assert(info->gangThreshold[7] >= 0); + assert(info->gangThreshold[8] >= 0); } // BUG: there might be a bug somewhere in there that causes |