浏览代码

Fix uninitialized scrolling state

Vadim Markovtsev 9 年之前
父节点
当前提交
d51c9a1ff0
共有 1 个文件被更改,包括 5 次插入15 次删除
  1. 5 15
      client/windows/CAdvmapInterface.cpp

+ 5 - 15
client/windows/CAdvmapInterface.cpp

@@ -476,19 +476,16 @@ CAdvMapInt::CAdvMapInt():
 	statusbar(ADVOPT.statusbarX,ADVOPT.statusbarY,ADVOPT.statusbarG),
 	statusbar(ADVOPT.statusbarX,ADVOPT.statusbarY,ADVOPT.statusbarG),
 	heroList(ADVOPT.hlistSize, Point(ADVOPT.hlistX, ADVOPT.hlistY), ADVOPT.hlistAU, ADVOPT.hlistAD),
 	heroList(ADVOPT.hlistSize, Point(ADVOPT.hlistX, ADVOPT.hlistY), ADVOPT.hlistAU, ADVOPT.hlistAD),
 	townList(ADVOPT.tlistSize, Point(ADVOPT.tlistX, ADVOPT.tlistY), ADVOPT.tlistAU, ADVOPT.tlistAD),
 	townList(ADVOPT.tlistSize, Point(ADVOPT.tlistX, ADVOPT.tlistY), ADVOPT.tlistAU, ADVOPT.tlistAD),
-	infoBar(Rect(ADVOPT.infoboxX, ADVOPT.infoboxY, 192, 192) ),
-	activeMapPanel(nullptr)
+	infoBar(Rect(ADVOPT.infoboxX, ADVOPT.infoboxY, 192, 192)), state(NA),
+  spellBeingCasted(nullptr), position(int3(0, 0, 0)), selection(nullptr),
+  updateScreen(false), anim(0), animValHitCount(0), heroAnim(0), heroAnimValHitCount(0),
+	activeMapPanel(nullptr), duringAITurn(false), scrollingDir(0), scrollingState(false)
 {
 {
-	duringAITurn = false;
-	state = NA;
-	spellBeingCasted = nullptr;
+  adventureInt = this;
 	pos.x = pos.y = 0;
 	pos.x = pos.y = 0;
 	pos.w = screen->w;
 	pos.w = screen->w;
 	pos.h = screen->h;
 	pos.h = screen->h;
-	position = int3(0,0,0);
-	selection = nullptr;
 	townList.onSelect = std::bind(&CAdvMapInt::selectionChanged,this);
 	townList.onSelect = std::bind(&CAdvMapInt::selectionChanged,this);
-	adventureInt=this;
 	bg = BitmapHandler::loadBitmap(ADVOPT.mainGraphic);
 	bg = BitmapHandler::loadBitmap(ADVOPT.mainGraphic);
 	if (ADVOPT.worldViewGraphic != "")
 	if (ADVOPT.worldViewGraphic != "")
 	{
 	{
@@ -499,13 +496,6 @@ CAdvMapInt::CAdvMapInt():
 		bgWorldView = nullptr;
 		bgWorldView = nullptr;
 		logGlobal->warn("ADVOPT.worldViewGraphic is empty => bitmap not loaded");
 		logGlobal->warn("ADVOPT.worldViewGraphic is empty => bitmap not loaded");
 	}
 	}
-	scrollingDir = 0;
-	updateScreen  = false;
-	anim=0;
-	animValHitCount=0; //animation frame
-	heroAnim=0;
-	heroAnimValHitCount=0; // hero animation frame
-
 	if (!bgWorldView)
 	if (!bgWorldView)
 	{
 	{
 		logGlobal->warn("bgWorldView not defined in resolution config; fallback to VWorld.bmp");
 		logGlobal->warn("bgWorldView not defined in resolution config; fallback to VWorld.bmp");