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

Function set_next_cycle_unpaused_ms

plugins/spectate.cpp:316–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316static void set_next_cycle_unpaused_ms(color_ostream &out, bool has_active_combat = false) {
317 int32_t delay_ms = config.follow_ms;
318 if (config.cinematic_action && has_active_combat) {
319 std::normal_distribution<float> distribution(config.follow_ms / 2, config.follow_ms / 6);
320 delay_ms = distribution(rng);
321 delay_ms = std::min(config.follow_ms, std::max(1, delay_ms));
322 }
323 DEBUG(cycle,out).print("next cycle in {} ms\n", delay_ms);
324 next_cycle_unpaused_ms = Core::getInstance().getUnpausedMs() + delay_ms;
325}
326
327DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) {
328 if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) {

Callers 4

follow_a_dwarfFunction · 0.85
spectate_followPrevFunction · 0.85
spectate_followNextFunction · 0.85

Calls 1

printMethod · 0.45

Tested by

no test coverage detected