1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

First version that compiles

This commit is contained in:
Tomasz Zieliński
2022-09-21 11:34:23 +02:00
parent b20f649521
commit 494b0f0226
93 changed files with 431 additions and 359 deletions

View File

@@ -701,13 +701,13 @@ DLL_LINKAGE void GiveHero::applyGs(CGameState *gs)
DLL_LINKAGE void NewObject::applyGs(CGameState *gs)
{
Terrain terrainType;
TTerrain terrainType = Terrain::BORDER;
if(ID == Obj::BOAT && !gs->isInTheMap(pos)) //special handling for bug #3060 - pos outside map but visitablePos is not
{
CGObjectInstance testObject = CGObjectInstance();
testObject.pos = pos;
testObject.appearance = VLC->objtypeh->getHandlerFor(ID, subID)->getTemplates(Terrain("water")).front();
testObject.appearance = VLC->objtypeh->getHandlerFor(ID, subID)->getTemplates(Terrain::WATER).front();
const int3 previousXAxisTile = int3(pos.x - 1, pos.y, pos.z);
assert(gs->isInTheMap(previousXAxisTile) && (testObject.visitablePos() == previousXAxisTile));
@@ -716,7 +716,7 @@ DLL_LINKAGE void NewObject::applyGs(CGameState *gs)
else
{
const TerrainTile & t = gs->map->getTile(pos);
terrainType = t.terType;
terrainType = t.terType->id;
}
CGObjectInstance *o = nullptr;
@@ -724,7 +724,7 @@ DLL_LINKAGE void NewObject::applyGs(CGameState *gs)
{
case Obj::BOAT:
o = new CGBoat();
terrainType = Terrain("water"); //TODO: either boat should only spawn on water, or all water objects should be handled this way
terrainType = Terrain::WATER; //TODO: either boat should only spawn on water, or all water objects should be handled this way
break;
case Obj::MONSTER: //probably more options will be needed
o = new CGCreature();