fix crash when hovering the mouse over invalid wall types
This commit is contained in:
parent
6b1e99a731
commit
7379a6b5ba
@ -740,6 +740,9 @@ void GameSave::readOPS(char * data, int dataLength)
|
|||||||
fanVelX[blockY+y][blockX+x] = (fanData[j++]-127.0f)/64.0f;
|
fanVelX[blockY+y][blockX+x] = (fanData[j++]-127.0f)/64.0f;
|
||||||
fanVelY[blockY+y][blockX+x] = (fanData[j++]-127.0f)/64.0f;
|
fanVelY[blockY+y][blockX+x] = (fanData[j++]-127.0f)/64.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blockMap[y][x] < 0 || blockMap[y][x] >= UI_WALLCOUNT)
|
||||||
|
blockMap[y][x] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1195,6 +1198,9 @@ void GameSave::readPSv(char * data, int dataLength)
|
|||||||
blockMap[y][x]=WL_GRAV;
|
blockMap[y][x]=WL_GRAV;
|
||||||
else if (blockMap[y][x]==O_WL_ALLOWENERGY)
|
else if (blockMap[y][x]==O_WL_ALLOWENERGY)
|
||||||
blockMap[y][x]=WL_ALLOWENERGY;
|
blockMap[y][x]=WL_ALLOWENERGY;
|
||||||
|
|
||||||
|
if (blockMap[y][x] < 0 || blockMap[y][x] >= UI_WALLCOUNT)
|
||||||
|
blockMap[y][x] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
|
@ -1298,7 +1298,7 @@ std::string GameController::ElementResolve(int type)
|
|||||||
|
|
||||||
std::string GameController::WallName(int type)
|
std::string GameController::WallName(int type)
|
||||||
{
|
{
|
||||||
if(gameModel && gameModel->GetSimulation() && gameModel->GetSimulation()->wtypes && type >= 0)
|
if(gameModel && gameModel->GetSimulation() && gameModel->GetSimulation()->wtypes && type >= 0 && type < UI_WALLCOUNT)
|
||||||
return std::string(gameModel->GetSimulation()->wtypes[type].name);
|
return std::string(gameModel->GetSimulation()->wtypes[type].name);
|
||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
|
Reference in New Issue
Block a user