Fix variable_out_of_scope warnings in Defense

master
Nicolas Hake 2018-07-23 12:07:46 +02:00
parent 1ef6b7a7fc
commit 7fb098c4df
1 changed files with 3 additions and 2 deletions

View File

@ -107,9 +107,10 @@ public func UpdateIndexedItem(int index)
for (var req in entry.requirements) for (var req in entry.requirements)
if (!techs[req]) if (!techs[req])
available = false; available = false;
var tier;
if (entry.tiers) if (entry.tiers)
{ {
var tier = techs[entry.tech]; tier = techs[entry.tech];
entry.graphic = Format(entry.graphics, tier+1); entry.graphic = Format(entry.graphics, tier+1);
entry.cost = entry.costs[tier]; entry.cost = entry.costs[tier];
} }
@ -385,4 +386,4 @@ private func GainLife(proplist entry, int tier)
clonk->DoEnergy(clonk.MaxEnergy, true); clonk->DoEnergy(clonk.MaxEnergy, true);
} }
return true; return true;
} }