1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00
* serializing icon index, otherwise creature portraits are gone after loading a game
* VCAI: fixed crash on attempting revisiting a boat (that is no longer present because it was boarded)
* Fixed strange crash with "neutral hero" (there should be no such thing... but somehow it appears, needs further investigation)
This commit is contained in:
Michał W. Urbańczyk
2012-09-28 20:49:23 +00:00
parent a669831fc6
commit 2ba0427432
4 changed files with 14 additions and 3 deletions

View File

@ -3539,6 +3539,10 @@ bool shouldVisit(HeroPtr h, const CGObjectInstance * obj)
case Obj::MAGIC_WELL: case Obj::MAGIC_WELL:
return h->mana < h->manaLimit(); return h->mana < h->manaLimit();
break; break;
case Obj::BOAT:
return false;
//Boats are handled by pathfinder
} }
if (obj->wasVisited(*h)) //it must pointer to hero instance, heroPtr calls function wasVisited(ui8 player); if (obj->wasVisited(*h)) //it must pointer to hero instance, heroPtr calls function wasVisited(ui8 player);

View File

@ -568,6 +568,12 @@ void CMapHandler::terrainRect( int3 top_tile, ui8 anim, const std::vector< std::
if(themp) //hero if(themp) //hero
{ {
if(themp->tempOwner >= GameConstants::PLAYER_LIMIT) //Neutral hero?
{
tlog1 << "A neutral hero (" << themp->name << ") at " << themp->pos << ". Should not happen!\n";
continue;
}
dir = themp->moveDir; dir = themp->moveDir;
//pick graphics of hero (or boat if hero is sailing) //pick graphics of hero (or boat if hero is sailing)

View File

@ -105,9 +105,10 @@ public:
& cost & upgradeNames & upgrades & cost & upgradeNames & upgrades
& fightValue & AIValue & growth & hordeGrowth & fightValue & AIValue & growth & hordeGrowth
& ammMin & ammMax & level & ammMin & ammMax & level
& abilityText & abilityRefs & animDefName & advMapDef & abilityText & abilityRefs & animDefName & advMapDef;
& idNumber & faction h & iconIndex;
h & idNumber & faction
& timeBetweenFidgets & walkAnimationTime & attackAnimationTime & flightAnimationDistance & timeBetweenFidgets & walkAnimationTime & attackAnimationTime & flightAnimationDistance
& upperRightMissleOffsetX & rightMissleOffsetX & lowerRightMissleOffsetX & upperRightMissleOffsetY & rightMissleOffsetY & lowerRightMissleOffsetY & upperRightMissleOffsetX & rightMissleOffsetX & lowerRightMissleOffsetX & upperRightMissleOffsetY & rightMissleOffsetY & lowerRightMissleOffsetY
& missleFrameAngles & troopCountLocationOffset & attackClimaxFrame; & missleFrameAngles & troopCountLocationOffset & attackClimaxFrame;

View File

@ -815,7 +815,7 @@ DLL_LINKAGE void AssembledArtifact::applyGs( CGameState *gs )
CArtifactInstance *constituentInstance = artSet->getArt(pos); CArtifactInstance *constituentInstance = artSet->getArt(pos);
//move constituent from hero to be part of new, combined artifact //move constituent from hero to be part of new, combined artifact
constituentInstance->removeFrom(al); constituentInstance->removeFrom(ArtifactLocation(al.artHolder, pos));
combinedArt->addAsConstituent(constituentInstance, pos); combinedArt->addAsConstituent(constituentInstance, pos);
if(!vstd::contains(combinedArt->artType->possibleSlots[artSet->bearerType()], al.slot) && vstd::contains(combinedArt->artType->possibleSlots[artSet->bearerType()], pos)) if(!vstd::contains(combinedArt->artType->possibleSlots[artSet->bearerType()], al.slot) && vstd::contains(combinedArt->artType->possibleSlots[artSet->bearerType()], pos))
al.slot = pos; al.slot = pos;