mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
Merge pull request #6827 from IvanSavenko/bugfixing
[1.7.2] Minor fixes for recently reported issues
This commit is contained in:
@@ -219,6 +219,7 @@ void ClientCommandManager::handleTranslateGameCommand(bool onlyMissing)
|
||||
}
|
||||
|
||||
printCommandMessage("Translation export complete");
|
||||
printCommandMessage("Extracted files can be found in " + outPath.string() + " directory\n");
|
||||
}
|
||||
|
||||
void ClientCommandManager::handleTranslateMapsCommand()
|
||||
@@ -301,6 +302,8 @@ void ClientCommandManager::handleTranslateMapsCommand()
|
||||
}
|
||||
|
||||
printCommandMessage("Translation export complete");
|
||||
printCommandMessage("Extracted files can be found in " + outPath.string() + " directory\n");
|
||||
|
||||
}
|
||||
|
||||
void ClientCommandManager::handleGetConfigCommand()
|
||||
|
||||
@@ -38,13 +38,6 @@
|
||||
"description" : "Custom animation to be used on battle, overrides hero class property",
|
||||
"format" : "animationFile"
|
||||
},
|
||||
"compatibilityIdentifiers" : {
|
||||
"type" : "array",
|
||||
"items" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"description" : "Additional identifiers that may refer to this object, to provide compatibility after object has been renamed"
|
||||
},
|
||||
"images" : {
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ class DLL_LINKAGE PlayerState : public CBonusSystemNode, public Player, public G
|
||||
|
||||
public:
|
||||
PlayerColor color;
|
||||
bool human; //true if human controlled player, false for AI
|
||||
bool human = false; //true if human controlled player, false for AI
|
||||
TeamID team;
|
||||
TResources resources;
|
||||
|
||||
|
||||
@@ -536,6 +536,7 @@ void CGameState::initPlayerStates()
|
||||
p.color=elem.first;
|
||||
p.human = elem.second.isControlledByHuman();
|
||||
p.team = map->players[elem.first.getNum()].team;
|
||||
logGlobal->debug("Player %d is controlled by %s, team %d", elem.first.getNum(), p.human ? "human" : "AI", p.team.getNum());
|
||||
teams[p.team].id = p.team;//init team
|
||||
teams[p.team].players.insert(elem.first);//add player to team
|
||||
}
|
||||
|
||||
@@ -501,6 +501,7 @@ void CVCMIServer::setPlayerConnectedId(PlayerSettings & pset, PlayerConnectionID
|
||||
else
|
||||
pset.name = LIBRARY->generaltexth->allTexts[468]; //Computer
|
||||
|
||||
logGlobal->debug("Player color %d will be controlled from connection %d", pset.color, static_cast<int>(player));
|
||||
pset.connectedPlayerIDs.clear();
|
||||
if(player != PlayerConnectionID::PLAYER_AI)
|
||||
pset.connectedPlayerIDs.insert(player);
|
||||
|
||||
@@ -1215,9 +1215,12 @@ void BattleActionProcessor::attackCasting(const CBattleInfoCallback & battle, bo
|
||||
TConstBonusListPtr spellsByType = attacker->getBonuses(Selector::typeSubtype(attackMode, BonusSubtypeID(spellID)));
|
||||
for(const auto & sf : *spellsByType)
|
||||
{
|
||||
int meleeRanged;
|
||||
vstd::amax(spellLevel, sf->parameters->toVector()[0]);
|
||||
meleeRanged = sf->parameters->toVector()[1];
|
||||
int meleeRanged = -1;
|
||||
if (sf->parameters)
|
||||
{
|
||||
vstd::amax(spellLevel, sf->parameters->toVector()[0]);
|
||||
meleeRanged = sf->parameters->toVector()[1];
|
||||
}
|
||||
|
||||
if (meleeRanged == -1 || meleeRanged == 0 || (meleeRanged == 1 && ranged) || (meleeRanged == 2 && !ranged))
|
||||
castMe = true;
|
||||
@@ -1261,7 +1264,7 @@ std::set<SpellID> BattleActionProcessor::getSpellsForAttackCasting(const TConstB
|
||||
for(int i = 0; i < spells->size(); i++)
|
||||
{
|
||||
std::shared_ptr<Bonus> bonus = spells->operator[](i);
|
||||
int layer = bonus->parameters->toVector()[2];
|
||||
int layer = bonus->parameters ? bonus->parameters->toVector()[2] : -1;
|
||||
vstd::amax(layer, -1);
|
||||
spellsWithBackupLayers[layer].push_back(bonus);
|
||||
}
|
||||
|
||||
@@ -284,17 +284,20 @@ void TurnOrderProcessor::doStartPlayerTurn(PlayerColor which)
|
||||
actingPlayers.insert(which);
|
||||
awaitingPlayers.erase(which);
|
||||
|
||||
auto turnQuery = std::make_shared<TimerPauseQuery>(gameHandler, which);
|
||||
if(gameHandler->gameInfo().getPlayerState(which)->isHuman())
|
||||
gameHandler->queries->addQuery(turnQuery);
|
||||
else
|
||||
turnQuery->queryID = QueryID::NONE;
|
||||
|
||||
PlayerStartsTurn pst;
|
||||
pst.player = which;
|
||||
pst.queryID = turnQuery->queryID;
|
||||
gameHandler->sendAndApply(pst);
|
||||
|
||||
bool timersActive = gameHandler->gameInfo().getStartInfo()->turnTimerInfo.isEnabled();
|
||||
bool isHuman = gameHandler->gameInfo().getPlayerState(which)->isHuman();
|
||||
|
||||
if(timersActive && isHuman)
|
||||
{
|
||||
auto turnQuery = std::make_shared<TimerPauseQuery>(gameHandler, which);
|
||||
gameHandler->queries->addQuery(turnQuery);
|
||||
pst.queryID = turnQuery->queryID;
|
||||
}
|
||||
|
||||
gameHandler->sendAndApply(pst);
|
||||
assert(!actingPlayers.empty());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user