MCPcopy Create free account
hub / github.com/DFHack/dfhack / IsDesignationChanged

Function IsDesignationChanged

plugins/remotefortressreader/remotefortressreader.cpp:670–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668std::map<DFCoord, uint16_t> waterHashes;
669
670bool IsDesignationChanged(DFCoord pos)
671{
672 uint16_t hash;
673 df::map_block * block = Maps::getBlock(pos);
674 if (block)
675 hash = fletcher16((uint8_t*)(block->designation), 16 * 16 * (sizeof(df::tile_designation)));
676 else
677 hash = 0;
678 if (waterHashes[pos] != hash)
679 {
680 waterHashes[pos] = hash;
681 return true;
682 }
683 return false;
684}
685
686std::map<DFCoord, uint8_t> buildingHashes;
687

Callers 1

GetBlockListFunction · 0.85

Calls 2

getBlockFunction · 0.85
fletcher16Function · 0.85

Tested by

no test coverage detected