1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Merge branch 'develop' into SpellsRefactoring4

This commit is contained in:
AlexVinS
2014-12-24 00:15:27 +03:00
46 changed files with 887 additions and 689 deletions

View File

@@ -109,7 +109,7 @@ const CGObjectInstance* CGameInfoCallback::getObj(ObjectInstanceID objid, bool v
return nullptr;
}
if(!isVisible(ret, player))
if(!isVisible(ret, player) && ret->tempOwner != player)
{
if(verbose)
logGlobal->errorStream() << "Cannot get object with id " << oid << ". Object is not visible.";
@@ -518,7 +518,8 @@ std::vector < const CGHeroInstance *> CPlayerSpecificInfoCallback::getHeroesInfo
std::vector < const CGHeroInstance *> ret;
for(auto hero : gs->map->heroesOnMap)
{
if( !player || (hero->tempOwner == *player) ||
// !player || // - why would we even get access to hero not owned by any player?
if((hero->tempOwner == *player) ||
(isVisible(hero->getPosition(false), player) && !onlyOur) )
{
ret.push_back(hero);