Update Maps::SortBlockEvents to include spoors and item spatters

develop
Quietust 2014-08-20 10:51:58 -05:00
parent ae80ca9ec9
commit deee486b81
2 changed files with 31 additions and 13 deletions

@ -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<df::block_square_event_mineralst *>* veins,
std::vector<df::block_square_event_frozen_liquidst *>* ices = 0,
std::vector<df::block_square_event_material_spatterst *>* splatter = 0,
std::vector<df::block_square_event_material_spatterst *>* materials = 0,
std::vector<df::block_square_event_grassst *>* grass = 0,
std::vector<df::block_square_event_world_constructionst *>* constructions = 0
std::vector<df::block_square_event_world_constructionst *>* constructions = 0,
std::vector<df::block_square_event_spoorst *>* spoors = 0,
std::vector<df::block_square_event_item_spatterst *>* items = 0
);
/// remove a block event from the block by address

@ -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 <df::block_square_event_mineralst *>* veins,
vector <df::block_square_event_frozen_liquidst *>* ices,
vector <df::block_square_event_material_spatterst *> *splatter,
vector <df::block_square_event_material_spatterst *> *materials,
vector <df::block_square_event_grassst *> *grasses,
vector <df::block_square_event_world_constructionst *> *constructions)
vector <df::block_square_event_world_constructionst *> *constructions,
vector <df::block_square_event_spoorst *> *spoors,
vector <df::block_square_event_item_spatterst *> *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;
}
}