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

Function makePowerMeter

plugins/power-meter.cpp:174–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174static bool makePowerMeter(df::pressure_plate_info *info, int min_power, int max_power, bool invert)
175{
176 CHECK_NULL_POINTER(info);
177
178 if (!enabled)
179 {
180 auto entry = World::GetPersistentData("power-meter/enabled", NULL);
181 if (!entry.isValid())
182 return false;
183
184 enable_hooks(true);
185 }
186
187 init_plate_info(*info);
188 info->track_min = min_power;
189 info->track_max = max_power;
190 info->flags.bits.citizens = invert;
191 return true;
192}
193
194DFHACK_PLUGIN_LUA_FUNCTIONS {
195 DFHACK_LUA_FUNCTION(makePowerMeter),

Callers

nothing calls this directly

Calls 3

init_plate_infoFunction · 0.85
enable_hooksFunction · 0.70
isValidMethod · 0.45

Tested by

no test coverage detected