Sfoglia il codice sorgente

Fix for mislaced hero rescued from Prison - https://bugs.vcmi.eu/view.php?id=3227

Tomasz Zieliński 3 anni fa
parent
commit
efb6580958
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      lib/mapObjects/CObjectHandler.cpp

+ 5 - 0
lib/mapObjects/CObjectHandler.cpp

@@ -210,6 +210,11 @@ void CGObjectInstance::setType(si32 ID, si32 subID)
 		appearance = handler->getTemplates(tile.terType)[0];
 	else
 		appearance = handler->getTemplates()[0]; // get at least some appearance since alternative is crash
+	if (ID == Obj::HERO)
+	{
+		//adjust for the prison offset
+		pos = visitablePos();
+	}
 	cb->gameState()->map->addBlockVisTiles(this);
 }