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

Function set_target

plugins/seedwatch.cpp:348–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346//
347
348static void set_target(color_ostream &out, int32_t id, int32_t target) {
349 if (target == 0)
350 remove_seed_config(out, id);
351 else {
352 if (id < 0 || (size_t)id >= world->raws.plants.all.size()) {
353 WARN(control,out).print(
354 "cannot set target for unknown plant id: {}\n", id);
355 return;
356 }
357 PersistentDataItem &c = ensure_seed_config(out, id);
358 c.set_int(SEED_CONFIG_TARGET, target);
359 }
360}
361
362// searches abbreviations, returns expansion if so, returns original if not
363static string searchAbbreviations(string in) {

Callers 1

seedwatch_setTargetFunction · 0.85

Calls 3

remove_seed_configFunction · 0.85
sizeMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected