Binsearch in units.active can't possibly work, ever.

develop
Alexander Gavrilov 2013-02-14 13:12:23 +04:00
parent 7cbd201f31
commit 8de172f1c8
1 changed files with 3 additions and 3 deletions

@ -35,12 +35,12 @@ void syndromeHandler(color_ostream& out, void* ptr) {
EventManager::SyndromeData* data = (EventManager::SyndromeData*)ptr;
//out.print("Syndrome started: unit %d, syndrome %d.\n", data->unitId, data->syndromeIndex);
int32_t index = df::unit::binsearch_index(df::global::world->units.active, data->unitId);
if ( index < 0 ) {
df::unit* unit = df::unit::find(data->unitId);
if (!unit) {
out.print("%s, line %d: couldn't find unit.\n", __FILE__, __LINE__);
return;
}
df::unit* unit = df::global::world->units.active[index];
df::unit_syndrome* unit_syndrome = unit->syndromes.active[data->syndromeIndex];
df::syndrome* syndrome = df::global::world->raws.syndromes.all[unit_syndrome->type];