1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00
This commit is contained in:
DjWarmonger 2014-10-01 11:38:03 +02:00
parent e40818f2c6
commit c832eab172

View File

@ -616,12 +616,15 @@ DLL_LINKAGE void GiveHero::applyGs( CGameState *gs )
DLL_LINKAGE void NewObject::applyGs( CGameState *gs )
{
const TerrainTile &t = gs->map->getTile(pos);
ETerrainType terrainType = t.terType;
CGObjectInstance *o = nullptr;
switch(ID)
{
case Obj::BOAT:
o = new CGBoat();
terrainType = ETerrainType::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();
@ -643,8 +646,7 @@ DLL_LINKAGE void NewObject::applyGs( CGameState *gs )
o->ID = ID;
o->subID = subID;
o->pos = pos;
const TerrainTile &t = gs->map->getTile(pos);
o->appearance = VLC->objtypeh->getHandlerFor(o->ID, o->subID)->getTemplates(t.terType).front();
o->appearance = VLC->objtypeh->getHandlerFor(o->ID, o->subID)->getTemplates(terrainType).front();
id = o->id = ObjectInstanceID(gs->map->objects.size());
gs->map->objects.push_back(o);