Просмотр исходного кода

Merge pull request #5767 from IvanSavenko/misc_fixes

Miscellaneous fixes
Ivan Savenko 4 месяцев назад
Родитель
Сommit
786324187d

+ 1 - 1
client/battle/BattleInterface.cpp

@@ -231,7 +231,7 @@ void BattleInterface::stacksAreAttacked(std::vector<StackAttackedInfo> attackedI
 {
 	stacksController->stacksAreAttacked(attackedInfos);
 
-	BattleSideArray<int> killedBySide;
+	BattleSideArray<int> killedBySide{0,0};
 
 	for(const StackAttackedInfo & attackedInfo : attackedInfos)
 	{

+ 4 - 0
client/windows/CCreatureWindow.cpp

@@ -851,6 +851,10 @@ void CStackWindow::initBonusesList()
 	BonusList receivedBonuses = *info->stackNode->getBonuses(CSelector(Bonus::Permanent), Selector::all);
 	BonusList abilities = info->creature->getExportedBonusList();
 
+	// remove all bonuses that are not propagated away
+	// such bonuses should be present in received bonuses, and if not - this means that they are behind inactive limiter, such as inactive stack experience bonuses
+	abilities.remove_if([](const Bonus* b){ return b->propagator == nullptr;});
+
 	const auto & bonusSortingPredicate = [this](const std::shared_ptr<Bonus> & v1, const std::shared_ptr<Bonus> & v2){
 		if (v1->source != v2->source)
 		{

+ 2 - 1
config/creatures/special.json

@@ -178,7 +178,8 @@
 			"noWallPenalty" : { "type" : "NO_WALL_PENALTY" },
 			"noDistancePenalty" : { "type" : "NO_DISTANCE_PENALTY" },
 			"noRetalitation" : { "type" : "BLOCKS_RANGED_RETALIATION" },
-			"noLuck" : { "type" : "NO_LUCK" }
+			"noLuck" : { "type" : "NO_LUCK" },
+			"attackAlwaysZero" : { "type" : "PRIMARY_SKILL", "subtype" : "attack", "val" : 0, "valueType" : "INDEPENDENT_MIN" }
 		},
 		"graphics" :
 		{

+ 3 - 0
docs/modders/Entities_Format/Faction_Format.md

@@ -66,6 +66,9 @@ Each town requires a set of buildings (Around 30-45 buildings)
 
 	// Faction alignment. Can be good, neutral (default) or evil.
 	"alignment" : "",
+	
+	// If set to true, RMG will prefer placing towns of this faction on subterranean level of the map
+	"preferUndergroundPlacement" : true,
 
 	// Backgrounds for creature screen, two versions: 120px-height and 130-px height
 	"creatureBackground"

+ 1 - 1
lib/mapObjects/CGTownInstance.cpp

@@ -201,7 +201,7 @@ int CGTownInstance::getDwellingBonus(const std::vector<CreatureID>& creatureIds,
 		const auto & dwellingCreatures = dwelling->asOwnable()->providedCreatures();
 		bool hasMatch = false;
 		for (const auto& creature : dwellingCreatures)
-			hasMatch = vstd::contains(creatureIds, creature);
+			hasMatch |= vstd::contains(creatureIds, creature);
 
 		if (hasMatch)
 			totalBonus += 1;

+ 4 - 1
lib/mapObjects/IObjectInterface.cpp

@@ -95,9 +95,12 @@ int3 IBoatGenerator::bestLocation() const
 			continue;
 
 		if (tile->blocked())
+			continue;
+
+		if (tile->visitable())
 		{
 			bool hasBoat = false;
-			for (auto const & objectID : tile->blockingObjects)
+			for (auto const & objectID : tile->visitableObjects)
 			{
 				const auto * object = getObject()->cb->getObj(objectID);
 				if (object->ID == Obj::BOAT || object->ID == Obj::HERO)