1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-05 15:05:40 +02:00

Merge pull request #4240 from IvanSavenko/bugfixing

[1.5.4] Bugfixing
This commit is contained in:
Ivan Savenko 2024-07-09 14:32:24 +03:00 committed by GitHub
commit e42285c2f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 24 additions and 11 deletions

View File

@ -32,7 +32,7 @@ struct SlotInfo
struct ArmyUpgradeInfo
{
std::vector<SlotInfo> resultingArmy;
uint64_t upgradeValue = 0;
int64_t upgradeValue = 0;
TResources upgradeCost;
void addArmyToBuy(std::vector<SlotInfo> army);

View File

@ -444,6 +444,8 @@ void AdventureMapInterface::onPlayerTurnStarted(PlayerColor playerID)
LOCPLINT->localState->setSelection(LOCPLINT->localState->getWanderingHero(0));
}
centerOnObject(LOCPLINT->localState->getCurrentArmy());
//show new day animation and sound on infobar, except for 1st day of the game
if (LOCPLINT->cb->getDate(Date::DAY) != 1)
widget->getInfoBar()->showDate();

View File

@ -252,7 +252,7 @@ Gives creature under effect of this spell additional bonus, which is hardcoded a
### SPECIAL_ADD_VALUE_ENCHANT
Increased effect of spell affecting creature, ie. Aenain makes Disrupting Ray decrease target's defense by additional 2 points:
Modifies 'val' parameter of spell effects that give bonuses by specified value. For example, Aenain makes Disrupting Ray decrease target's defense by additional 2 points:
```jsonc
"disruptingRay" : {
@ -263,11 +263,11 @@ Increased effect of spell affecting creature, ie. Aenain makes Disrupting Ray de
```
- subtype: affected spell identifier
- additionalInfo: value to add
- addInfo: value to modify 'val' parameter of targeted spell effects by
### SPECIAL_FIXED_VALUE_ENCHANT
Spell affecting creature has fixed effect, eg. hero Melody has constant spell effect of +3:
Changes 'val' parameter of spell effects that give bonuses to a specified value. For example, Fortune cast by Melody always modifies luck by +3:
```jsonc
"fortune" : {
@ -278,7 +278,7 @@ Spell affecting creature has fixed effect, eg. hero Melody has constant spell ef
```
- subtype: affected spell identifier
- additionalInfo = fixed value
- addInfo: value to set 'val' parameter of targeted spell effects to
### SPECIAL_UPGRADE

View File

@ -196,7 +196,7 @@ std::shared_ptr<Bonus> OwnerUpdater::createUpdatedBonus(const std::shared_ptr<Bo
owner = PlayerColor::NEUTRAL;
std::shared_ptr<Bonus> updated =
std::make_shared<Bonus>(b->duration, b->type, b->source, b->val, b->sid, b->subtype, b->valType);
std::make_shared<Bonus>(*b);
updated->limiter = std::make_shared<OppositeSideLimiter>(owner);
return updated;
}

View File

@ -2416,7 +2416,7 @@ void CatapultAttack::applyBattle(IBattleState * battleState)
void BattleSetStackProperty::applyGs(CGameState * gs) const
{
CStack * stack = gs->getBattle(battleID)->getStack(stackID);
CStack * stack = gs->getBattle(battleID)->getStack(stackID, false);
switch(which)
{
case CASTS:

View File

@ -441,6 +441,11 @@ void CGameHandler::changeSecSkill(const CGHeroInstance * hero, SecondarySkill wh
if (hero->visitedTown)
giveSpells(hero->visitedTown, hero);
// Our scouting range may have changed - update it
if (hero->getOwner().isValidPlayer())
changeFogOfWar(hero->getSightCenter(), hero->getSightRadius(), hero->getOwner(), ETileVisibility::REVEALED);
}
void CGameHandler::handleClientDisconnection(std::shared_ptr<CConnection> c)
@ -4293,6 +4298,9 @@ void CGameHandler::changeFogOfWar(int3 center, ui32 radius, PlayerColor player,
void CGameHandler::changeFogOfWar(std::unordered_set<int3> &tiles, PlayerColor player, ETileVisibility mode)
{
if (tiles.empty())
return;
FoWChange fow;
fow.tiles = tiles;
fow.player = player;

View File

@ -177,13 +177,16 @@ bool TurnOrderProcessor::computeCanActSimultaneously(PlayerColor active, PlayerC
assert(activeInfo);
assert(waitingInfo);
if (gameHandler->hasBothPlayersAtSameConnection(active, waiting))
if (activeInfo->human != waitingInfo->human)
{
// only one AI and one human can play simultaneoulsy from single connection
if (!gameHandler->getStartInfo()->simturnsInfo.allowHumanWithAI)
return false;
// only one AI and one human can play simultaneoulsy from single connection
if (activeInfo->human == waitingInfo->human)
}
else
{
// two AI or two humans in hotseat can't play at the same time
if (gameHandler->hasBothPlayersAtSameConnection(active, waiting))
return false;
}