1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +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(); return t->town->buildings[structure->building->bid]->Name();
else//dwellings - recruit %creature% else//dwellings - recruit %creature%
{ {
int creaID = t->creatures[(bid-30)%GameConstants::CREATURES_PER_TOWN].second.back();//taking last of available creatures auto & availableCreatures = t->creatures[(bid-30)%GameConstants::CREATURES_PER_TOWN].second;
return CGI->generaltexth->allTexts[16] + " " + CGI->creh->creatures[creaID]->namePl; 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() CGPreGame::~CGPreGame()
{ {
boost::unique_lock<boost::recursive_mutex> lock(*CPlayerInterface::pim);
disposeGraphics(); disposeGraphics();
if(CGP == this) if(CGP == this)
CGP = nullptr; CGP = nullptr;
if(GH.curInt == this)
GH.curInt = nullptr;
} }
void CGPreGame::openSel(CMenuScreen::EState screenType, CMenuScreen::EMultiMode multi /*= CMenuScreen::SINGLE_PLAYER*/) 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|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='RD|x64'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='RD|x64'" />
</PropertyGroup> </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'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<AdditionalOptions>/MP4 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/MP4 %(AdditionalOptions)</AdditionalOptions>