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

Function rate_limit_complaining

plugins/autonestbox.cpp:309–315  ·  view source on GitHub ↗

rate limit to one message per season assumes this gets run at least once a season, which is true when enabled running manually with the "now" param also resets did_complain, so we won't miss the case where the player happens to run "autonestbox now" once a year in Spring

Source from the content-addressed store, hash-verified

307// won't miss the case where the player happens to run "autonestbox now"
308// once a year in Spring
309static void rate_limit_complaining() {
310 static df::season old_season = df::season::None;
311 df::season this_season = *cur_season;
312 if (old_season != this_season)
313 did_complain = false;
314 old_season = this_season;
315}
316
317static size_t assign_nestboxes(color_ostream &out) {
318 rate_limit_complaining();

Callers 1

assign_nestboxesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected