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

Function isItemChanged

plugins/remotefortressreader/remotefortressreader.cpp:744–758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742std::map<int, uint16_t> itemHashes;
743
744bool isItemChanged(int i)
745{
746 uint16_t hash = 0;
747 auto item = df::item::find(i);
748 if (item)
749 {
750 hash = fletcher16((uint8_t*)item, sizeof(df::item));
751 }
752 if (itemHashes[i] != hash)
753 {
754 itemHashes[i] = hash;
755 return true;
756 }
757 return false;
758}
759
760bool areItemsChanged(std::vector<int> * items)
761{

Callers 1

areItemsChangedFunction · 0.85

Calls 2

fletcher16Function · 0.85
findFunction · 0.50

Tested by

no test coverage detected