| 172 | } |
| 173 | |
| 174 | static 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 | |
| 194 | DFHACK_PLUGIN_LUA_FUNCTIONS { |
| 195 | DFHACK_LUA_FUNCTION(makePowerMeter), |
nothing calls this directly
no test coverage detected