1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Uploading misc tweaks.

This commit is contained in:
DjWarmonger 2014-07-01 07:07:40 +02:00
parent a556ef64e9
commit bda71bed83
6 changed files with 18 additions and 8 deletions

View File

@ -15,7 +15,7 @@ SPELLS:
* New configuration format: http://wiki.vcmi.eu/index.php?title=Spell_Format
RANDOM MAP GENERATOR
* Towns from mods can be used
* Towns form mods cna be used
* Reading connections, terrains, towns and mines from template
* Zone placement
* Zone borders and connections, fractalized paths inside zones

View File

@ -2,7 +2,7 @@
{
"Analogy" :
{
"minSize" : "s", "maxSize" : "m",
"minSize" : "m", "maxSize" : "m",
"players" : "4",
"zones" :
{
@ -63,7 +63,7 @@
},
"Upgrade" :
{
"minSize" : "m", "maxSize" : "m",
"minSize" : "s", "maxSize" : "m",
"players" : "2",
"zones" :
{

View File

@ -163,6 +163,7 @@ DLL_LINKAGE void HeroVisitCastle::applyGs( CGameState *gs )
assert(h);
assert(t);
if(start())
t->setVisitingHero(h);
else

View File

@ -907,7 +907,13 @@ bool CGTownInstance::addBonusIfBuilt(BuildingID building, Bonus::BonusType type,
void CGTownInstance::setVisitingHero(CGHeroInstance *h)
{
assert(!!visitingHero == !h);
if (!(!!visitingHero == !h))
{
logGlobal->warnStream() << boost::format("Hero visiting town %s is %s ") % name % (visitingHero.get() ? visitingHero->name : "NULL");
logGlobal->warnStream() << boost::format("New hero will be %s ") % (h ? h->name : "NULL");
assert(!!visitingHero == !h);
}
if(h)
{
PlayerState *p = cb->gameState()->getPlayer(h->tempOwner);

View File

@ -246,7 +246,7 @@ int3 CGObjectInstance::getVisitableOffset() const
if (appearance.isVisitableAt(x, y))
return int3(x,y,0);
logGlobal->warnStream() << "Warning: getVisitableOffset called on non-visitable obj!";
//logGlobal->warnStream() << "Warning: getVisitableOffset called on non-visitable obj!";
return int3(0,0,0);
}

View File

@ -761,7 +761,7 @@ void CRmgTemplateZone::initTownType (CMapGenerator* gen)
playerInfo.allowedFactions.clear();
playerInfo.allowedFactions.insert (townType);
playerInfo.hasMainTown = true;
playerInfo.posOfMainTown = town->pos - int3(2, 0, 0);
playerInfo.posOfMainTown = town->pos - town->getVisitableOffset();
playerInfo.generateHeroAtMainTown = true;
//now create actual towns
@ -1264,8 +1264,11 @@ bool CRmgTemplateZone::guardObject(CMapGenerator* gen, CGObjectInstance* object,
gen->setOccupied (guardTile, ETileType::USED);
}
else
gen->setOccupied (guardTile, ETileType::FREE);
else //allow no guard or other object in front of this object
{
for (auto tile : tiles)
gen->setOccupied (tile, ETileType::FREE);
}
return true;
}