1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-25 12:14:46 +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 * New configuration format: http://wiki.vcmi.eu/index.php?title=Spell_Format
RANDOM MAP GENERATOR RANDOM MAP GENERATOR
* Towns from mods can be used * Towns form mods cna be used
* Reading connections, terrains, towns and mines from template * Reading connections, terrains, towns and mines from template
* Zone placement * Zone placement
* Zone borders and connections, fractalized paths inside zones * Zone borders and connections, fractalized paths inside zones

View File

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

View File

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

View File

@ -907,7 +907,13 @@ bool CGTownInstance::addBonusIfBuilt(BuildingID building, Bonus::BonusType type,
void CGTownInstance::setVisitingHero(CGHeroInstance *h) 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) if(h)
{ {
PlayerState *p = cb->gameState()->getPlayer(h->tempOwner); PlayerState *p = cb->gameState()->getPlayer(h->tempOwner);

View File

@ -246,7 +246,7 @@ int3 CGObjectInstance::getVisitableOffset() const
if (appearance.isVisitableAt(x, y)) if (appearance.isVisitableAt(x, y))
return int3(x,y,0); 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); return int3(0,0,0);
} }

View File

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