Sfoglia il codice sorgente

Removed 0.98 compatibility

Ivan Savenko 2 anni fa
parent
commit
526de47ca4
3 ha cambiato i file con 5 aggiunte e 16 eliminazioni
  1. 1 12
      lib/CTownHandler.cpp
  2. 0 2
      lib/CTownHandler.h
  3. 4 2
      lib/spells/effects/Obstacle.cpp

+ 1 - 12
lib/CTownHandler.cpp

@@ -177,12 +177,6 @@ CTown::~CTown()
 		str.dellNull();
 }
 
-std::vector<BattleHex> CTown::defaultMoatHexes()
-{
-	static const std::vector<BattleHex> moatHexes = {11, 28, 44, 61, 77, 111, 129, 146, 164, 181};
-	return moatHexes;
-}
-
 std::string CTown::getLocalizedFactionName() const
 {
 	if(faction == nullptr)
@@ -855,12 +849,7 @@ void CTownHandler::loadTown(CTown * town, const JsonNode & source)
 	warMachinesToLoad[town] = source["warMachine"];
 
 	town->moatDamage = static_cast<si32>(source["moatDamage"].Float());
-
-	// Compatibility for <= 0.98f mods
-	if(source["moatHexes"].isNull())
-		town->moatHexes = CTown::defaultMoatHexes();
-	else
-		town->moatHexes = source["moatHexes"].convertTo<std::vector<BattleHex> >();
+	town->moatHexes = source["moatHexes"].convertTo<std::vector<BattleHex> >();
 
 	town->mageLevel = static_cast<ui32>(source["mageGuild"].Float());
 	town->names = source["names"].convertTo<std::vector<std::string> >();

+ 0 - 2
lib/CTownHandler.h

@@ -232,8 +232,6 @@ class DLL_LINKAGE CTown
 public:
 	CTown();
 	~CTown();
-	// TODO: remove once save and mod compatability not needed
-	static std::vector<BattleHex> defaultMoatHexes();
 
 	std::string getLocalizedFactionName() const;
 	std::string getBuildingScope() const;

+ 4 - 2
lib/spells/effects/Obstacle.cpp

@@ -258,9 +258,11 @@ bool Obstacle::isHexAvailable(const CBattleInfoCallback * cb, const BattleHex &
 	{
 		EWallPart part = cb->battleHexToWallPart(hex);
 
-		if(part == EWallPart::INVALID || part == EWallPart::INDESTRUCTIBLE_PART_OF_GATE)
+		if(part == EWallPart::INVALID)
 			return true;//no fortification here
-		else if(static_cast<int>(part) < 0)
+		else if(part == EWallPart::INDESTRUCTIBLE_PART_OF_GATE)
+			return false; // location accessible to units, but not targetable by spells
+		else if(part == EWallPart::INDESTRUCTIBLE_PART)
 			return false;//indestructible part (cant be checked by battleGetWallState)
 		else if(part == EWallPart::BOTTOM_TOWER || part == EWallPart::UPPER_TOWER)
 			return false;//destructible, but should not be available