1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Merge branch 'develop' of https://github.com/vcmi/vcmi into develop

This commit is contained in:
DjWarmonger 2015-02-22 18:36:23 +01:00
commit a736a863da
4 changed files with 13 additions and 7 deletions

View File

@ -424,7 +424,7 @@ void CToggleGroup::addToggle(int identifier, CToggleBase* bt)
}
CToggleGroup::CToggleGroup(const CFunctionList<void(int)> &OnChange, bool musicLikeButtons)
: onChange(OnChange), musicLike(musicLikeButtons), selectedID(-1)
: onChange(OnChange), selectedID(-1), musicLike(musicLikeButtons)
{}
void CToggleGroup::setSelected(int id)

View File

@ -1192,7 +1192,8 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
CGPath &path = LOCPLINT->paths[h];
terrain.currentPath = &path;
if(!LOCPLINT->cb->getPathsInfo(h)->getPath(h->getPosition(false) + dir, path))
int3 dst = h->getPosition(false) + dir;
if(dst != verifyPos(dst) || !LOCPLINT->cb->getPathsInfo(h)->getPath(dst, path))
{
terrain.currentPath = nullptr;
return;
@ -1604,9 +1605,10 @@ void CAdvMapInt::tileHovered(const int3 &mapPos)
{
const CGGarrison* garrObj = dynamic_cast<const CGGarrison*>(objAtTile); //TODO evil evil cast!
// Show battle cursor for guarded enemy garrisons, otherwise movement cursor.
if (garrObj && garrObj->stacksCount()
&& !LOCPLINT->cb->getPlayerRelations( LOCPLINT->playerID, garrObj->tempOwner) )
// Show battle cursor for guarded enemy garrisons or garrisons have guarding creature behind, otherwise movement cursor.
if (garrObj && ((garrObj->stacksCount()
&& !LOCPLINT->cb->getPlayerRelations( LOCPLINT->playerID, garrObj->tempOwner))
|| guardingCreature))
CCS->curh->changeGraphic(ECursor::ADVENTURE, 5 + turns*6);
else
CCS->curh->changeGraphic(ECursor::ADVENTURE, 9 + turns*6);

View File

@ -120,8 +120,8 @@ CQuestLog::CQuestLog (const std::vector<QuestInfo> & Quests) :
questIndex(0),
currentQuest(nullptr),
componentsBox(nullptr),
quests (Quests),
hideComplete(false),
quests(Quests),
slider(nullptr)
{
OBJ_CONSTRUCTION_CAPTURING_ALL;

View File

@ -1747,7 +1747,11 @@ bool CGameHandler::moveHero( ObjectInstanceID hid, int3 dst, ui8 teleporting, Pl
tmh.result = result;
sendAndApply(&tmh);
if(lookForGuards == CHECK_FOR_GUARDS && this->isInTheMap(guardPos))
if (visitDest == VISIT_DEST && t.topVisitableObj() && t.topVisitableObj()->id == h->id)
{ // Hero should be always able to visit any object he staying on even if there guards around
visitObjectOnTile(t, h);
}
else if(lookForGuards == CHECK_FOR_GUARDS && this->isInTheMap(guardPos))
{
tmh.attackedFrom = guardPos;