(svn r17725) -Codechange: Reduce usage of EngInfo and XxxVehInfo, esp. when a Engine * is already present.

This commit is contained in:
frosch
2009-10-06 19:17:07 +00:00
parent 95dfee1c60
commit f3aacb8fe3
12 changed files with 88 additions and 68 deletions

View File

@@ -161,8 +161,9 @@ static RefitList *BuildRefitList(const Vehicle *v)
uint i;
do {
uint32 cmask = EngInfo(u->engine_type)->refit_mask;
byte callback_mask = EngInfo(u->engine_type)->callback_mask;
const Engine *e = Engine::Get(u->engine_type);
uint32 cmask = e->info.refit_mask;
byte callback_mask = e->info.callback_mask;
/* Skip this engine if it has no capacity */
if (u->cargo_cap == 0) continue;