Terrain templates with hidden tiles now work correctly.

This commit is contained in:
Justin Marshall
2020-07-02 15:23:41 -07:00
parent 16bca743d7
commit 6101c8c8f0
2 changed files with 9 additions and 4 deletions
+4
View File
@@ -178,6 +178,10 @@ public:
uint8_t* ptr = reinterpret_cast<uint8_t*>(this);
ptr += sizeof(IsoTileHeader_t);
uint32_t* offsets = (uint32_t*)ptr;
if (offsets[idx] == 0 || offsets[idx] == WESTWOOD_ISO_NOTSET_FLAG) {
return NULL;
}
IsoTileImageHeader* tileImageHeaders = (IsoTileImageHeader*)(((uint8_t*)this) + offsets[idx]);
return tileImageHeaders;
}
+5 -4
View File
@@ -41,7 +41,7 @@
#include "function.h"
#include "template.h"
#include "image.h"
/***********************************************************************************************
* TemplateClass::Init -- Resets the template object system. *
@@ -87,8 +87,9 @@ bool TemplateClass::Mark(MarkType mark)
assert(IsActive);
static bool noup = false;
void const * iset = Get_Image_Data();
if (iset && ObjectClass::Mark(mark)) {
IsoTile* isoTile = (IsoTile *)Get_Image_Data();
if (isoTile && ObjectClass::Mark(mark)) {
//void * map = Get_Icon_Set_Map(iset);
@@ -106,7 +107,7 @@ bool TemplateClass::Mark(MarkType mark)
*/
//char * mapptr = (char*)map;
//bool real = (mapptr[number] != -1);
if(isoTile->GetTileInfo(number) != NULL)
{
/*
** Lift the terrain object from the map.