1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

One more small fix for possible issues with gate surface

This commit is contained in:
Arseniy Shestakov 2016-03-14 12:55:57 +03:00
parent af05b025e7
commit 4240ecad01

View File

@ -2836,9 +2836,11 @@ CBattleInterface::SiegeHelper::SiegeHelper(const CGTownInstance *siegeTown, cons
CBattleInterface::SiegeHelper::~SiegeHelper()
{
for(auto & elem : walls)
auto gateState = owner->curInt->cb->battleGetGateState();
for(int g = 0; g < ARRAY_COUNT(walls); ++g)
{
SDL_FreeSurface(elem);
if(g != SiegeHelper::GATE || (gateState != EGateState::CLOSED && gateState != EGateState::BLOCKED))
SDL_FreeSurface(walls[g]);
}
}