1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Minor fixes

This commit is contained in:
nordsoft 2023-09-22 00:52:19 +02:00
parent f8b8ab0965
commit 099109b7d2
2 changed files with 3 additions and 5 deletions

View File

@ -663,10 +663,8 @@ void CGameState::initDifficulty()
logGlobal->debug("\tLoading difficulty settings");
const JsonNode config(JsonPath::builtin("config/difficulty.json"));
const JsonVector &vector = config["battleBonus"].Vector();
const JsonNode &level = vector[scenarioOps->difficulty];
const JsonNode & difficultyAI(level["ai"][GameConstants::DIFFICULTY_NAMES[scenarioOps->difficulty]]);
const JsonNode & difficultyHuman(level["human"][GameConstants::DIFFICULTY_NAMES[scenarioOps->difficulty]]);
const JsonNode & difficultyAI(config["ai"][GameConstants::DIFFICULTY_NAMES[scenarioOps->difficulty]]);
const JsonNode & difficultyHuman(config["human"][GameConstants::DIFFICULTY_NAMES[scenarioOps->difficulty]]);
auto setDifficulty = [](PlayerState & state, const JsonNode & json)
{

View File

@ -117,7 +117,7 @@ void BattleProcessor::startBattlePrimary(const CArmedInstance *army1, const CArm
//add battle bonuses based from player state only when attacks neutral creatures
const auto * attackerInfo = gameHandler->getPlayerState(army1->getOwner(), false);
if(attackerInfo && army2->getOwner() == PlayerColor::NEUTRAL)
if(attackerInfo && !army2->getOwner().isValidPlayer())
{
for(auto bonus : attackerInfo->battleBonuses)
{