1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

* fixed race condition crash

* no crash when there is no creature in dwelling (that should not happen at all... but)
* removed paths from vcxproj, use property sheets
This commit is contained in:
Michał W. Urbańczyk 2013-02-07 15:27:22 +00:00
parent af5287c193
commit 124d732171
3 changed files with 15 additions and 15 deletions

View File

@ -205,8 +205,17 @@ std::string getBuildingSubtitle(const CStructure * structure)//hover text for bu
return t->town->buildings[structure->building->bid]->Name();
else//dwellings - recruit %creature%
{
int creaID = t->creatures[(bid-30)%GameConstants::CREATURES_PER_TOWN].second.back();//taking last of available creatures
return CGI->generaltexth->allTexts[16] + " " + CGI->creh->creatures[creaID]->namePl;
auto & availableCreatures = t->creatures[(bid-30)%GameConstants::CREATURES_PER_TOWN].second;
if(availableCreatures.size())
{
int creaID = availableCreatures.back();//taking last of available creatures
return CGI->generaltexth->allTexts[16] + " " + CGI->creh->creatures[creaID]->namePl;
}
else
{
tlog2 << "Problem: dwelling with id " << bid << " offers no creatures!\n";
return "#ERROR#";
}
}
}

View File

@ -471,9 +471,13 @@ CGPreGame::CGPreGame():
CGPreGame::~CGPreGame()
{
boost::unique_lock<boost::recursive_mutex> lock(*CPlayerInterface::pim);
disposeGraphics();
if(CGP == this)
CGP = nullptr;
if(GH.curInt == this)
GH.curInt = nullptr;
}
void CGPreGame::openSel(CMenuScreen::EState screenType, CMenuScreen::EMultiMode multi /*= CMenuScreen::SINGLE_PLAYER*/)

View File

@ -92,19 +92,6 @@
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='RD|x64'" />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include;C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Lib;$(SolutionDir)..\libs\$(PlatformShortName);$(VCMI_Out);$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'">
<IncludePath>C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include;C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include;C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'">
<IncludePath>C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include;C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalOptions>/MP4 %(AdditionalOptions)</AdditionalOptions>