| 921 | } |
| 922 | |
| 923 | static void manageSyndromeEvent(color_ostream& out) { |
| 924 | if (!df::global::world) |
| 925 | return; |
| 926 | multimap<Plugin*,EventHandler> copy(handlers[EventType::SYNDROME].begin(), handlers[EventType::SYNDROME].end()); |
| 927 | int32_t highestTime = -1; |
| 928 | |
| 929 | std::vector<SyndromeData> new_syndrome_data; |
| 930 | for (auto unit : df::global::world->units.all) { |
| 931 | |
| 932 | /* |
| 933 | if ( unit->flags1.bits.inactive ) |
| 934 | continue; |
| 935 | */ |
| 936 | for ( size_t b = 0; b < unit->syndromes.active.size(); b++ ) { |
| 937 | df::unit_syndrome* syndrome = unit->syndromes.active[b]; |
| 938 | int32_t startTime = syndrome->year*ticksPerYear + syndrome->year_time; |
| 939 | if ( startTime > highestTime ) |
| 940 | highestTime = startTime; |
| 941 | if ( startTime <= lastSyndromeTime ) |
| 942 | continue; |
| 943 | |
| 944 | new_syndrome_data.emplace_back(unit->id, b); |
| 945 | } |
| 946 | } |
| 947 | for (auto& data : new_syndrome_data) { |
| 948 | for (auto &[_,handle] : copy) { |
| 949 | DEBUG(log,out).print("calling handler for syndrome event\n"); |
| 950 | run_handler(out, EventType::SYNDROME, handle, (void*)&data); |
| 951 | } |
| 952 | } |
| 953 | |
| 954 | lastSyndromeTime = highestTime; |
| 955 | } |
| 956 | |
| 957 | static void manageInvasionEvent(color_ostream& out) { |
| 958 | if (!df::global::plotinfo) |
nothing calls this directly
no test coverage detected