mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
More fixes:
- logical expressions should compile without cpp include - fixed #1608 and #1610
This commit is contained in:
parent
b3b523b768
commit
b1e638d1af
@ -24,7 +24,6 @@
|
||||
#include "../lib/GameConstants.h"
|
||||
#include "gui/CGuiHandler.h"
|
||||
#include "gui/CIntObjectClasses.h"
|
||||
#include "../lib/LogicalExpression.cpp"
|
||||
|
||||
using namespace boost::assign;
|
||||
|
||||
|
@ -1109,6 +1109,7 @@ void CPlayerInterface::showBlockingDialog( const std::string &text, const std::v
|
||||
void CPlayerInterface::tileRevealed(const std::unordered_set<int3, ShashInt3> &pos)
|
||||
{
|
||||
EVENT_HANDLER_CALLED_BY_CLIENT;
|
||||
//FIXME: wait for dialog? Magi hut/eye would benefit from this but may break other areas
|
||||
for(auto & po : pos)
|
||||
adventureInt->minimap.showTile(po);
|
||||
if(!pos.empty())
|
||||
@ -1571,14 +1572,9 @@ void CPlayerInterface::centerView (int3 pos, int focusTime)
|
||||
adventureInt->centerOn (pos);
|
||||
if(focusTime)
|
||||
{
|
||||
bool activeAdv = (GH.topInt() == adventureInt && adventureInt->isActive());
|
||||
if(activeAdv)
|
||||
adventureInt->deactivate();
|
||||
|
||||
GH.totalRedraw();
|
||||
CSDL_Ext::update(screen);
|
||||
SDL_Delay(focusTime);
|
||||
|
||||
if(activeAdv)
|
||||
adventureInt->activate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2287,12 +2287,17 @@ struct statsHLP
|
||||
|
||||
void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
{
|
||||
auto playerInactive = [&](PlayerColor color)
|
||||
{
|
||||
return color == PlayerColor::NEUTRAL || players.at(color).status != EPlayerStatus::INGAME;
|
||||
};
|
||||
|
||||
#define FILL_FIELD(FIELD, VAL_GETTER) \
|
||||
{ \
|
||||
std::vector< std::pair< PlayerColor, si64 > > stats; \
|
||||
for(auto g = players.begin(); g != players.end(); ++g) \
|
||||
{ \
|
||||
if(g->second.color == PlayerColor::NEUTRAL) \
|
||||
if(playerInactive(g->second.color)) \
|
||||
continue; \
|
||||
std::pair< PlayerColor, si64 > stat; \
|
||||
stat.first = g->second.color; \
|
||||
@ -2304,7 +2309,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
|
||||
for(auto & elem : players)
|
||||
{
|
||||
if(elem.second.color != PlayerColor::NEUTRAL)
|
||||
if(!playerInactive(elem.second.color))
|
||||
tgi.playerColors.push_back(elem.second.color);
|
||||
}
|
||||
|
||||
@ -2317,7 +2322,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
//best hero's portrait
|
||||
for(auto g = players.cbegin(); g != players.cend(); ++g)
|
||||
{
|
||||
if(g->second.color == PlayerColor::NEUTRAL)
|
||||
if(playerInactive(g->second.color))
|
||||
continue;
|
||||
const CGHeroInstance * best = statsHLP::findBestHero(this, g->second.color);
|
||||
InfoAboutHero iah;
|
||||
@ -2362,7 +2367,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
{
|
||||
for(auto g = players.cbegin(); g != players.cend(); ++g)
|
||||
{
|
||||
if(g->second.color == PlayerColor::NEUTRAL) //do nothing for neutral player
|
||||
if(playerInactive(g->second.color)) //do nothing for neutral player
|
||||
continue;
|
||||
if(g->second.human)
|
||||
{
|
||||
@ -2380,7 +2385,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
//best creatures belonging to player (highest AI value)
|
||||
for(auto g = players.cbegin(); g != players.cend(); ++g)
|
||||
{
|
||||
if(g->second.color == PlayerColor::NEUTRAL) //do nothing for neutral player
|
||||
if(playerInactive(g->second.color)) //do nothing for neutral player
|
||||
continue;
|
||||
int bestCre = -1; //best creature's ID
|
||||
for(auto & elem : g->second.heroes)
|
||||
|
@ -185,7 +185,7 @@ namespace LogicalExpressionDetail
|
||||
}
|
||||
};
|
||||
|
||||
std::string getTextForOperator(std::string operation);
|
||||
std::string DLL_LINKAGE getTextForOperator(std::string operation);
|
||||
|
||||
/// Prints expression in human-readable format
|
||||
template <typename ContainedClass>
|
||||
|
Loading…
Reference in New Issue
Block a user