mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
- build system update
- fixed gcc\clang warnings
This commit is contained in:
parent
d390113c23
commit
d69f4b7632
2
Global.h
2
Global.h
@ -373,7 +373,7 @@ namespace vstd
|
||||
auto minElementByFun(const ForwardRange& rng, ValueFunction vf) -> decltype(boost::begin(rng))
|
||||
{
|
||||
typedef decltype(*boost::begin(rng)) ElemType;
|
||||
return boost::min_element(rng, [&] (const ElemType &lhs, const ElemType &rhs) -> bool
|
||||
return boost::min_element(rng, [&] (ElemType lhs, ElemType rhs) -> bool
|
||||
{
|
||||
return vf(lhs) < vf(rhs);
|
||||
});
|
||||
|
@ -224,7 +224,7 @@ BattleHex BattleInfo::getClosestTile (bool attackerOwned, int initialPos, std::s
|
||||
int BattleInfo::getAvaliableHex(TCreature creID, bool attackerOwned, int initialPos) const
|
||||
{
|
||||
bool twoHex = VLC->creh->creatures[creID]->isDoubleWide();
|
||||
bool flying = VLC->creh->creatures[creID]->isFlying();
|
||||
//bool flying = VLC->creh->creatures[creID]->isFlying();
|
||||
|
||||
int pos;
|
||||
if (initialPos > -1)
|
||||
|
@ -8,6 +8,9 @@
|
||||
|
||||
#define RETURN_IF_NOT_BATTLE(X) if(!duringBattle()) {tlog1 << __FUNCTION__ << " called when no battle!\n"; return X; }
|
||||
|
||||
//allocate static member
|
||||
const int ReachabilityInfo::INFINITE_DIST;
|
||||
|
||||
namespace SiegeStuffThatShouldBeMovedToHandlers // <=== TODO
|
||||
{
|
||||
static int lineToWallHex(int line) //returns hex with wall in given line (y coordinate)
|
||||
@ -356,7 +359,7 @@ bool CBattleInfoEssentials::battleCanSurrender(int player) const
|
||||
bool CBattleInfoEssentials::battleHasHero(ui8 side) const
|
||||
{
|
||||
RETURN_IF_NOT_BATTLE(false);
|
||||
assert(side >= 0 && side < 2);
|
||||
assert(side < 2);
|
||||
return getBattle()->heroes[side];
|
||||
}
|
||||
|
||||
@ -457,7 +460,7 @@ std::set<BattleHex> CBattleInfoCallback::battleGetAttackedHexes(const CStack* at
|
||||
}
|
||||
BOOST_FOREACH (BattleHex tile, at.friendlyCreaturePositions)
|
||||
{
|
||||
if(const CStack * st = battleGetStackByPos(tile, true)) //friendly stacks can also be damaged by Dragon Breath
|
||||
if(battleGetStackByPos(tile, true)) //friendly stacks can also be damaged by Dragon Breath
|
||||
{
|
||||
attackedHexes.insert(tile);
|
||||
}
|
||||
@ -982,7 +985,7 @@ TDmgRange CBattleInfoCallback::battleEstimateDamage(const CStack * attacker, con
|
||||
RETURN_IF_NOT_BATTLE(std::make_pair(0, 0));
|
||||
|
||||
const bool shooting = battleCanShoot(attacker, defender->position);
|
||||
const ui8 mySide = !attacker->attackerOwned;
|
||||
//const ui8 mySide = !attacker->attackerOwned;
|
||||
|
||||
TDmgRange ret = calculateDmgRange(attacker, defender, shooting, 0, false, false, false);
|
||||
|
||||
@ -1298,7 +1301,7 @@ AttackableTiles CBattleInfoCallback::getPotentiallyAttackableHexes(const CStack*
|
||||
BOOST_FOREACH (BattleHex tile, hexes)
|
||||
{
|
||||
//friendly stacks can also be damaged by Dragon Breath
|
||||
if(const CStack * st = battleGetStackByPos(tile, true))
|
||||
if(battleGetStackByPos(tile, true))
|
||||
at.friendlyCreaturePositions.insert(tile);
|
||||
}
|
||||
}
|
||||
@ -1528,7 +1531,7 @@ ESpellCastProblem::ESpellCastProblem CBattleInfoCallback::battleCanCastThisSpell
|
||||
RETURN_IF_NOT_BATTLE(ESpellCastProblem::INVALID);
|
||||
const ui8 side = playerToSide(player);
|
||||
if(!battleDoWeKnowAbout(side))
|
||||
ESpellCastProblem::INVALID;
|
||||
return ESpellCastProblem::INVALID;
|
||||
|
||||
ESpellCastProblem::ESpellCastProblem genProblem = battleCanCastSpell(player, mode);
|
||||
if(genProblem != ESpellCastProblem::OK)
|
||||
|
@ -17,6 +17,7 @@ set(lib_SRCS
|
||||
BattleHex.cpp
|
||||
BattleState.cpp
|
||||
CArtHandler.cpp
|
||||
CBattleCallback.cpp
|
||||
CBuildingHandler.cpp
|
||||
CCampaignHandler.cpp
|
||||
CConsoleHandler.cpp
|
||||
|
@ -21,6 +21,8 @@ libvcmi_la_SOURCES = \
|
||||
BattleState.h \
|
||||
CArtHandler.cpp \
|
||||
CArtHandler.h \
|
||||
CBattleCallback.cpp \
|
||||
CBattleCallback.h \
|
||||
CBuildingHandler.cpp \
|
||||
CBuildingHandler.h \
|
||||
CCampaignHandler.cpp \
|
||||
|
@ -91,20 +91,20 @@ am_libvcmi_la_OBJECTS = libvcmi_la-CBinaryReader.lo \
|
||||
libvcmi_la-CLodArchiveLoader.lo libvcmi_la-CMemoryStream.lo \
|
||||
libvcmi_la-CResourceLoader.lo libvcmi_la-BattleAction.lo \
|
||||
libvcmi_la-BattleState.lo libvcmi_la-CArtHandler.lo \
|
||||
libvcmi_la-CBuildingHandler.lo libvcmi_la-CCampaignHandler.lo \
|
||||
libvcmi_la-CConsoleHandler.lo libvcmi_la-CCreatureHandler.lo \
|
||||
libvcmi_la-CCreatureSet.lo libvcmi_la-CDefObjInfoHandler.lo \
|
||||
libvcmi_la-CGameInterface.lo libvcmi_la-CGameState.lo \
|
||||
libvcmi_la-CGeneralTextHandler.lo libvcmi_la-CHeroHandler.lo \
|
||||
libvcmi_la-CLogger.lo libvcmi_la-CMapInfo.lo \
|
||||
libvcmi_la-CModHandler.lo libvcmi_la-CObjectHandler.lo \
|
||||
libvcmi_la-CObstacleInstance.lo libvcmi_la-CSpellHandler.lo \
|
||||
libvcmi_la-CTownHandler.lo libvcmi_la-CThreadHelper.lo \
|
||||
libvcmi_la-Connection.lo libvcmi_la-HeroBonus.lo \
|
||||
libvcmi_la-IGameCallback.lo libvcmi_la-JsonNode.lo \
|
||||
libvcmi_la-NetPacksLib.lo libvcmi_la-ResourceSet.lo \
|
||||
libvcmi_la-BattleHex.lo libvcmi_la-VCMI_Lib.lo \
|
||||
libvcmi_la-map.lo
|
||||
libvcmi_la-CBattleCallback.lo libvcmi_la-CBuildingHandler.lo \
|
||||
libvcmi_la-CCampaignHandler.lo libvcmi_la-CConsoleHandler.lo \
|
||||
libvcmi_la-CCreatureHandler.lo libvcmi_la-CCreatureSet.lo \
|
||||
libvcmi_la-CDefObjInfoHandler.lo libvcmi_la-CGameInterface.lo \
|
||||
libvcmi_la-CGameState.lo libvcmi_la-CGeneralTextHandler.lo \
|
||||
libvcmi_la-CHeroHandler.lo libvcmi_la-CLogger.lo \
|
||||
libvcmi_la-CMapInfo.lo libvcmi_la-CModHandler.lo \
|
||||
libvcmi_la-CObjectHandler.lo libvcmi_la-CObstacleInstance.lo \
|
||||
libvcmi_la-CSpellHandler.lo libvcmi_la-CTownHandler.lo \
|
||||
libvcmi_la-CThreadHelper.lo libvcmi_la-Connection.lo \
|
||||
libvcmi_la-HeroBonus.lo libvcmi_la-IGameCallback.lo \
|
||||
libvcmi_la-JsonNode.lo libvcmi_la-NetPacksLib.lo \
|
||||
libvcmi_la-ResourceSet.lo libvcmi_la-BattleHex.lo \
|
||||
libvcmi_la-VCMI_Lib.lo libvcmi_la-map.lo
|
||||
libvcmi_la_OBJECTS = $(am_libvcmi_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
@ -313,6 +313,8 @@ libvcmi_la_SOURCES = \
|
||||
BattleState.h \
|
||||
CArtHandler.cpp \
|
||||
CArtHandler.h \
|
||||
CBattleCallback.cpp \
|
||||
CBattleCallback.h \
|
||||
CBuildingHandler.cpp \
|
||||
CBuildingHandler.h \
|
||||
CCampaignHandler.cpp \
|
||||
@ -454,6 +456,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvcmi_la-BattleHex.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvcmi_la-BattleState.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvcmi_la-CArtHandler.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvcmi_la-CBattleCallback.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvcmi_la-CBinaryReader.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvcmi_la-CBuildingHandler.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvcmi_la-CCampaignHandler.Plo@am__quote@
|
||||
@ -587,6 +590,13 @@ libvcmi_la-CArtHandler.lo: CArtHandler.cpp
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvcmi_la_CXXFLAGS) $(CXXFLAGS) -c -o libvcmi_la-CArtHandler.lo `test -f 'CArtHandler.cpp' || echo '$(srcdir)/'`CArtHandler.cpp
|
||||
|
||||
libvcmi_la-CBattleCallback.lo: CBattleCallback.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvcmi_la_CXXFLAGS) $(CXXFLAGS) -MT libvcmi_la-CBattleCallback.lo -MD -MP -MF $(DEPDIR)/libvcmi_la-CBattleCallback.Tpo -c -o libvcmi_la-CBattleCallback.lo `test -f 'CBattleCallback.cpp' || echo '$(srcdir)/'`CBattleCallback.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvcmi_la-CBattleCallback.Tpo $(DEPDIR)/libvcmi_la-CBattleCallback.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CBattleCallback.cpp' object='libvcmi_la-CBattleCallback.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvcmi_la_CXXFLAGS) $(CXXFLAGS) -c -o libvcmi_la-CBattleCallback.lo `test -f 'CBattleCallback.cpp' || echo '$(srcdir)/'`CBattleCallback.cpp
|
||||
|
||||
libvcmi_la-CBuildingHandler.lo: CBuildingHandler.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvcmi_la_CXXFLAGS) $(CXXFLAGS) -MT libvcmi_la-CBuildingHandler.lo -MD -MP -MF $(DEPDIR)/libvcmi_la-CBuildingHandler.Tpo -c -o libvcmi_la-CBuildingHandler.lo `test -f 'CBuildingHandler.cpp' || echo '$(srcdir)/'`CBuildingHandler.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvcmi_la-CBuildingHandler.Tpo $(DEPDIR)/libvcmi_la-CBuildingHandler.Plo
|
||||
|
Loading…
Reference in New Issue
Block a user