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

Function validate_seed_config

plugins/seedwatch.cpp:88–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86// it can be removed once saves from 50.09 are no longer loadable
87
88static bool validate_seed_config(color_ostream& out, PersistentDataItem c)
89{
90 int seed_id = c.get_int(SEED_CONFIG_ID);
91 auto plant = df::plant_raw::find(seed_id);
92 if (!plant) {
93 WARN(control,out).print("discarded invalid seed id: {}\n", seed_id);
94 return false;
95 }
96 bool valid = (!plant->flags.is_set(df::enums::plant_raw_flags::TREE));
97 if (!valid) {
98 DEBUG(control, out).print("invalid configuration for {} discarded\n", plant->id);
99 }
100 return valid;
101}
102
103static const int32_t CYCLE_TICKS = 1229;
104static int32_t cycle_timestamp = 0; // world->frame_counter at last cycle

Callers 1

Calls 3

is_setMethod · 0.80
findFunction · 0.50
printMethod · 0.45

Tested by

no test coverage detected