mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Add setting to allow previous VCMI mechanics of dimension door
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#include "../CPlayerInterface.h"
|
||||
|
||||
#include "../../CCallback.h"
|
||||
#include "../../lib/CConfigHandler.h"
|
||||
#include "../../lib/GameSettings.h"
|
||||
#include "../../lib/StartInfo.h"
|
||||
#include "../../lib/CGeneralTextHandler.h"
|
||||
#include "../../lib/spells/CSpellHandler.h"
|
||||
@@ -533,7 +533,12 @@ void AdventureMapInterface::onTileLeftClicked(const int3 &targetPosition)
|
||||
performSpellcasting(targetPosition);
|
||||
break;
|
||||
case SpellID::DIMENSION_DOOR:
|
||||
const TerrainTile *targetTile = LOCPLINT->cb->getTileForDimensionDoor(targetPosition, LOCPLINT->localState->getCurrentHero());
|
||||
bool allowOnlyToUncoveredTiles = VLC->settings()->getBoolean(EGameSettings::DIMENSION_DOOR_ONLY_TO_UNCOVERED_TILES);
|
||||
|
||||
const TerrainTile * targetTile = allowOnlyToUncoveredTiles
|
||||
? LOCPLINT->cb->getTile(targetPosition, false)
|
||||
: LOCPLINT->cb->getTileForDimensionDoor(targetPosition, LOCPLINT->localState->getCurrentHero());
|
||||
|
||||
if(targetTile && targetTile->isClear(heroTile))
|
||||
performSpellcasting(targetPosition);
|
||||
break;
|
||||
@@ -663,7 +668,12 @@ void AdventureMapInterface::onTileHovered(const int3 &targetPosition)
|
||||
}
|
||||
case SpellID::DIMENSION_DOOR:
|
||||
{
|
||||
const TerrainTile * t = LOCPLINT->cb->getTileForDimensionDoor(targetPosition, LOCPLINT->localState->getCurrentHero());
|
||||
bool allowOnlyToUncoveredTiles = VLC->settings()->getBoolean(EGameSettings::DIMENSION_DOOR_ONLY_TO_UNCOVERED_TILES);
|
||||
|
||||
const TerrainTile * t = allowOnlyToUncoveredTiles
|
||||
? LOCPLINT->cb->getTile(targetPosition, false)
|
||||
: LOCPLINT->cb->getTileForDimensionDoor(targetPosition, LOCPLINT->localState->getCurrentHero());
|
||||
|
||||
if(t && t->isClear(LOCPLINT->cb->getTile(heroPosition))/* && isInScreenRange(hpos, mapPos)*/)
|
||||
CCS->curh->set(Cursor::Map::TELEPORT); //TODO: something wrong with beyond east spell range border cursor on arrogance after TP-ing near underground portal on previous day
|
||||
else
|
||||
|
Reference in New Issue
Block a user