Remove random bad asserts

develop
Petr Mrázek 2012-03-29 20:18:14 +02:00
parent 69b1bbe59e
commit 0c2c94fa92
3 changed files with 16 additions and 2 deletions

@ -590,8 +590,10 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
if (labor == df::enums::unit_labor::NONE)
continue;
/*
assert(labor >= 0);
assert(labor < ARRAY_COUNT(labor_infos));
*/
if (labor_infos[labor].is_exclusive && dwarfs[dwarf]->status.labors[labor])
dwarf_info[dwarf].mastery_penalty -= 100;
@ -636,8 +638,10 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
{
int job = dwarfs[dwarf]->job.current_job->job_type;
/*
assert(job >= 0);
assert(job < ARRAY_COUNT(dwarf_states));
*/
dwarf_info[dwarf].state = dwarf_states[job];
}
@ -656,8 +660,10 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
int labor = ENUM_ATTR(job_skill, labor, skill);
if (labor != df::enums::unit_labor::NONE)
{
/*
assert(labor >= 0);
assert(labor < ARRAY_COUNT(labor_to_skill));
*/
labor_to_skill[labor] = skill;
}
@ -670,8 +676,10 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
if (labor == df::enums::unit_labor::NONE)
continue;
/*
assert(labor >= 0);
assert(labor < ARRAY_COUNT(labor_infos));
*/
labors.push_back(labor);
}
@ -684,8 +692,10 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
{
auto labor = *lp;
/*
assert(labor >= 0);
assert(labor < ARRAY_COUNT(labor_infos));
*/
df::job_skill skill = labor_to_skill[labor];
@ -864,8 +874,10 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out )
if (labor == df::enums::unit_labor::NONE)
continue;
/*
assert(labor >= 0);
assert(labor < ARRAY_COUNT(labor_infos));
*/
if (labor_infos[labor].mode != HAULERS)
continue;

@ -95,7 +95,8 @@ void printCurrentModes(t_gamemodes gm, Console & con)
command_result mode (color_ostream &out_, vector <string> & parameters)
{
assert(out_.is_console());
if(!out_.is_console())
return CR_FAILURE;
Console &out = static_cast<Console&>(out_);
string command = "";

@ -524,7 +524,8 @@ command_result df_tiletypes (color_ostream &out, vector <string> & parameters)
}
}
assert(out.is_console());
if(!out.is_console())
return CR_FAILURE;
Console &con = static_cast<Console&>(out);
TileType filter, paint;