[Scummvm-git-logs] scummvm master -> 088d701f24044dd11b8aed5b4ed4e33bf3f40374

aquadran noreply at scummvm.org
Mon Oct 31 15:03:52 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
088d701f24 ICB: Fix an off-by-one in InitWeather()


Commit: 088d701f24044dd11b8aed5b4ed4e33bf3f40374
    https://github.com/scummvm/scummvm/commit/088d701f24044dd11b8aed5b4ed4e33bf3f40374
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-10-31T16:03:47+01:00

Commit Message:
ICB: Fix an off-by-one in InitWeather()

Changed paths:
    engines/icb/set_pc.cpp


diff --git a/engines/icb/set_pc.cpp b/engines/icb/set_pc.cpp
index 735d53b01f7..1de9ccfe77f 100644
--- a/engines/icb/set_pc.cpp
+++ b/engines/icb/set_pc.cpp
@@ -1338,7 +1338,7 @@ void _set::InitWeather(int32 type, int32 particleQty, int32 lightning, int32 win
 	if (m_wParticleQty > WEATHER_MAX_PARTICLES)
 		m_wParticleQty = WEATHER_MAX_PARTICLES;
 
-	for (int32 i = WEATHER_MAX_PARTICLES; i >= 0; i--) {
+	for (int32 i = WEATHER_MAX_PARTICLES - 1; i >= 0; i--) {
 		m_wParticleX[i] = (int16)((g_icb->getRandomSource()->getRandomNumber(WEATHER_SCREEN_WIDTH - 1)) - WEATHER_HALF_SCREEN_WIDTH);
 		m_wParticleY[i] = (int16)((g_icb->getRandomSource()->getRandomNumber(WEATHER_SCREEN_HEIGHT - 1)) - WEATHER_HALF_SCREEN_HEIGHT);
 		m_wParticleZ[i] = (int16)((g_icb->getRandomSource()->getRandomNumber(WEATHER_SCREEN_DEPTH - 1)) - WEATHER_HALF_SCREEN_DEPTH);




More information about the Scummvm-git-logs mailing list