mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
AGS: Fix undefined behavior in initialization of AGSSnowRain
Due to the declaration order of the member variables, the _screenWidth and _screenHeight where used before being initialized to initialize the _snow and _rain variables. This could then lead to a division by zero. This fixes bug #12771: AGS King's Quest 3 VGA from IA crashes on startup
This commit is contained in:
@@ -37,11 +37,11 @@ namespace AGSSnowRain {
|
||||
class AGSSnowRain : public PluginBase {
|
||||
SCRIPT_HASH(AGSSnowRain)
|
||||
private:
|
||||
Weather _rain;
|
||||
Weather _snow;
|
||||
int32 _screenWidth = 320;
|
||||
int32 _screenHeight = 200;
|
||||
int32 _screenColorDepth = 32;
|
||||
Weather _rain;
|
||||
Weather _snow;
|
||||
|
||||
private:
|
||||
void srSetWindSpeed(ScriptMethodParams ¶ms);
|
||||
|
||||
Reference in New Issue
Block a user