mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-21 00:19:29 +02:00
Fixed #1909
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user