1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Move VievXXX logic to server side (except expert ViewEarth)

This commit is contained in:
AlexVinS
2015-02-26 17:15:17 +03:00
parent b6038240ab
commit f4c683cd5e
19 changed files with 263 additions and 112 deletions

View File

@@ -2189,25 +2189,11 @@ void CPlayerInterface::advmapSpellCast(const CGHeroInstance * caster, int spellI
}
const CSpell * spell = CGI->spellh->objects[spellID];
if(spellID == SpellID::VIEW_AIR)
if(spellID == SpellID::VIEW_EARTH)
{
//TODO: implement on server side
int level = caster->getSpellSchoolLevel(spell);
adventureInt->worldViewOptions.showAllArtifacts = true;
adventureInt->worldViewOptions.showAllHeroes = (level>1);
adventureInt->worldViewOptions.showAllTowns = (level>2);
viewWorldMap();
}
else if(spellID == SpellID::VIEW_EARTH)
{
int level = caster->getSpellSchoolLevel(spell);
adventureInt->worldViewOptions.showAllResources = true;
adventureInt->worldViewOptions.showAllMines = (level>1);
adventureInt->worldViewOptions.showAllTerrain = (level>2);
viewWorldMap();
}
auto castSoundPath = spell->getCastSound();
@@ -2724,3 +2710,13 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance* h, CGPath path)
duringMovement = false;
}
void CPlayerInterface::showWorldViewEx(const std::vector<ObjectPosInfo>& objectPositions)
{
EVENT_HANDLER_CALLED_BY_CLIENT;
//TODO: showWorldViewEx
std::copy(objectPositions.begin(), objectPositions.end(), std::back_inserter(adventureInt->worldViewOptions.iconPositions));
viewWorldMap();
}