diff --git a/plugins/devel/steam-engine.cpp b/plugins/devel/steam-engine.cpp index ef708d11f..5c344f788 100644 --- a/plugins/devel/steam-engine.cpp +++ b/plugins/devel/steam-engine.cpp @@ -105,7 +105,7 @@ void decrement_flow(df::coord pos, int amount) auto pldes = Maps::getTileDesignation(pos); if (!pldes) return; - int nsize = std::max(0, pldes->bits.flow_size - amount); + int nsize = std::max(0, int(pldes->bits.flow_size - amount)); pldes->bits.flow_size = nsize; pldes->bits.flow_forbid = (nsize > 3 || pldes->bits.liquid_type == tile_liquid::Magma); @@ -382,7 +382,7 @@ struct workshop_hook : df::building_workshopst { if (!liquid) continue; - if (cnt == 0 || random() < RAND_MAX/2) + if (cnt == 0 || rand() < RAND_MAX/2) { cnt++; boil_unit(liquid); diff --git a/scripts/devel/lsmem.lua b/scripts/devel/lsmem.lua new file mode 100644 index 000000000..75586324d --- /dev/null +++ b/scripts/devel/lsmem.lua @@ -0,0 +1,14 @@ +-- Prints memory ranges of the process. + +for _,v in ipairs(dfhack.internal.getMemRanges()) do + local access = { '-', '-', '-', 'p' } + if v.read then access[1] = 'r' end + if v.write then access[2] = 'w' end + if v.execute then access[3] = 'x' end + if not v.valid then + access[4] = '?' + elseif v.shared then + access[4] = 's' + end + print(string.format('%08x-%08x %s %s', v.start_addr, v.end_addr, table.concat(access), v.name)) +end