mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-27 21:49:10 +02:00
parent
b54489ecb7
commit
9ce3c78387
@ -169,6 +169,7 @@ bool CCallback::swapArtifacts(const IArtifactSetBase * src, ui16 pos1, const IAr
|
||||
else if (stack1 && stack2)
|
||||
{
|
||||
//TODO: merge stacks?
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
@ -394,9 +395,9 @@ void CCallback::unregisterMyInterface()
|
||||
void CCallback::validatePaths()
|
||||
{
|
||||
const CGHeroInstance *h = cl->IGameCallback::getSelectedHero(player);
|
||||
if(cl->pathInfo->hero != h //wrong hero
|
||||
|| cl->pathInfo->hpos != h->getPosition(false) //wrong hero positoin
|
||||
|| !cl->pathInfo->isValid) //paths invalidated by game event
|
||||
if(h && ( cl->pathInfo->hero != h //wrong hero
|
||||
|| cl->pathInfo->hpos != h->getPosition(false) //wrong hero positoin
|
||||
|| !cl->pathInfo->isValid)) //paths invalidated by game event
|
||||
{
|
||||
recalculatePaths();
|
||||
}
|
||||
|
30
Global.h
30
Global.h
@ -82,11 +82,15 @@ typedef boost::int32_t si32; //signed int 32 bits (4 bytes)
|
||||
typedef boost::int16_t si16; //signed int 16 bits (2 bytes)
|
||||
typedef boost::int8_t si8; //signed int 8 bits (1 byte)
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ )
|
||||
#endif
|
||||
|
||||
// Import + Export macro declarations
|
||||
#ifdef _WIN32
|
||||
#define DLL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#if defined(__GNUC__) && GCC_VERSION >= 400
|
||||
#define DLL_EXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define DLL_EXPORT
|
||||
@ -96,7 +100,7 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte)
|
||||
#ifdef _WIN32
|
||||
#define DLL_IMPORT __declspec(dllimport)
|
||||
#else
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#if defined(__GNUC__) && GCC_VERSION >= 400
|
||||
#define DLL_IMPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define DLL_IMPORT
|
||||
@ -112,10 +116,23 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte)
|
||||
//defining available c++11 features
|
||||
|
||||
//initialization lists - only gcc-4.4 or later
|
||||
#if defined(__GNUC__) && ( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4 ))
|
||||
#if defined(__GNUC__) && (GCC_VERSION >= 404)
|
||||
#define CPP11_USE_INITIALIZERS_LIST
|
||||
#endif
|
||||
|
||||
//nullptr - only msvc and gcc-4.6 or later, othervice define it as NULL
|
||||
#if !defined(_MSC_VER) && !(defined(__GNUC__) && (GCC_VERSION >= 406))
|
||||
#define nullptr NULL
|
||||
#endif
|
||||
|
||||
//override keyword - only msvc and gcc-4.7 or later.
|
||||
#if !defined(_MSC_VER) && !(defined(__GNUC__) && (GCC_VERSION >= 407))
|
||||
#define override
|
||||
#endif
|
||||
|
||||
//workaround to support existing code
|
||||
#define OVERRIDE override
|
||||
|
||||
//a normal std::map with a const operator[] for sanity
|
||||
template<typename KeyT, typename ValT>
|
||||
class bmap : public std::map<KeyT, ValT>
|
||||
@ -307,13 +324,6 @@ using vstd::operator-=;
|
||||
template<typename T, size_t N> char (&_ArrayCountObj(const T (&)[N]))[N];
|
||||
#define ARRAY_COUNT(arr) (sizeof(_ArrayCountObj(arr)))
|
||||
|
||||
//for explicit overrides
|
||||
#ifdef _MSC_VER
|
||||
#define OVERRIDE override
|
||||
#else
|
||||
#define OVERRIDE //is there any working counterpart?
|
||||
#endif
|
||||
|
||||
//XXX pls dont - 'debug macros' are usually more trouble than it's worth
|
||||
#define HANDLE_EXCEPTION \
|
||||
catch (const std::exception& e) { \
|
||||
|
@ -1895,6 +1895,8 @@ void CAdvMapInt::tileHovered(const int3 &tile)
|
||||
CCS->curh->changeGraphic(0, 3);
|
||||
else if(objAtTile->ID == GameConstants::HEROI_TYPE && objAtTile->tempOwner == LOCPLINT->playerID)
|
||||
CCS->curh->changeGraphic(0, 2);
|
||||
else
|
||||
CCS->curh->changeGraphic(0, 0);
|
||||
}
|
||||
else
|
||||
CCS->curh->changeGraphic(0, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user