From d3ef96cc052bd83c33cee5d8344bd6a528b9da71 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 2 Mar 2023 17:49:28 -0800 Subject: [PATCH] allow MaterialInfo structs to be sorted --- library/include/modules/Materials.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/include/modules/Materials.h b/library/include/modules/Materials.h index 74acf5a8d..4018fcb2a 100644 --- a/library/include/modules/Materials.h +++ b/library/include/modules/Materials.h @@ -169,6 +169,9 @@ namespace DFHack inline bool operator!= (const MaterialInfo &a, const MaterialInfo &b) { return a.type != b.type || a.index != b.index; } + inline bool operator< (const MaterialInfo &a, const MaterialInfo &b) { + return a.type < b.type || (a.type == b.type && a.index < b.index); + } DFHACK_EXPORT bool isSoilInorganic(int material); DFHACK_EXPORT bool isStoneInorganic(int material);