From deee486b8176a68c7fde76776e5ea68b998c1dc7 Mon Sep 17 00:00:00 2001 From: Quietust Date: Wed, 20 Aug 2014 10:51:58 -0500 Subject: [PATCH] Update Maps::SortBlockEvents to include spoors and item spatters --- library/include/modules/Maps.h | 8 ++++++-- library/modules/Maps.cpp | 36 +++++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/library/include/modules/Maps.h b/library/include/modules/Maps.h index bf0271527..0d00b966f 100644 --- a/library/include/modules/Maps.h +++ b/library/include/modules/Maps.h @@ -45,6 +45,8 @@ distribution. #include "df/block_square_event_world_constructionst.h" #include "df/block_square_event_material_spatterst.h" #include "df/block_square_event_grassst.h" +#include "df/block_square_event_spoorst.h" +#include "df/block_square_event_item_spatterst.h" #include "df/tile_liquid.h" #include "df/tile_dig_designation.h" #include "df/tile_traffic.h" @@ -301,9 +303,11 @@ DFHACK_EXPORT df::flow_info *spawnFlow(df::coord pos, df::flow_type type, int ma extern DFHACK_EXPORT bool SortBlockEvents(df::map_block *block, std::vector* veins, std::vector* ices = 0, - std::vector* splatter = 0, + std::vector* materials = 0, std::vector* grass = 0, - std::vector* constructions = 0 + std::vector* constructions = 0, + std::vector* spoors = 0, + std::vector* items = 0 ); /// remove a block event from the block by address diff --git a/library/modules/Maps.cpp b/library/modules/Maps.cpp index 89eae64ed..8a1a6a7e3 100644 --- a/library/modules/Maps.cpp +++ b/library/modules/Maps.cpp @@ -386,20 +386,26 @@ bool Maps::ReadFeatures(df::map_block * block, t_feature * local, t_feature * gl bool Maps::SortBlockEvents(df::map_block *block, vector * veins, vector * ices, - vector *splatter, + vector *materials, vector *grasses, - vector *constructions) + vector *constructions, + vector *spoors, + vector *items) { if (veins) veins->clear(); if (ices) ices->clear(); - if (splatter) - splatter->clear(); - if (grasses) - grasses->clear(); if (constructions) constructions->clear(); + if (materials) + materials->clear(); + if (grasses) + grasses->clear(); + if (spoors) + spoors->clear(); + if (items) + items->clear(); if (!block) return false; @@ -418,17 +424,25 @@ bool Maps::SortBlockEvents(df::map_block *block, if (ices) ices->push_back((df::block_square_event_frozen_liquidst *)evt); break; + case block_square_event_type::world_construction: + if (constructions) + constructions->push_back((df::block_square_event_world_constructionst *)evt); + break; case block_square_event_type::material_spatter: - if (splatter) - splatter->push_back((df::block_square_event_material_spatterst *)evt); + if (materials) + materials->push_back((df::block_square_event_material_spatterst *)evt); break; case block_square_event_type::grass: if (grasses) grasses->push_back((df::block_square_event_grassst *)evt); break; - case block_square_event_type::world_construction: - if (constructions) - constructions->push_back((df::block_square_event_world_constructionst *)evt); + case block_square_event_type::spoor: + if (spoors) + spoors->push_back((df::block_square_event_spoorst *)evt); + break; + case block_square_event_type::item_spatter: + if (items) + items->push_back((df::block_square_event_item_spatterst *)evt); break; } }