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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user