Remove incorrect comment and merge nested conditionals.
This commit is contained in:
@@ -121,17 +121,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (Info.TotalCap > 0)
|
if (Info.TotalCap > 0)
|
||||||
{
|
{
|
||||||
var totalCount = permanentTokens.Values.Sum(t => t.Count) + timedTokens.Count;
|
var totalCount = permanentTokens.Values.Sum(t => t.Count) + timedTokens.Count;
|
||||||
if (totalCount >= Info.TotalCap)
|
if (totalCount >= Info.TotalCap && timedTokens.Count > 0)
|
||||||
{
|
{
|
||||||
// Prefer tokens from the same source
|
var expire = timedTokens[0].Token;
|
||||||
if (timedTokens.Count > 0)
|
if (self.TokenValid(expire))
|
||||||
{
|
self.RevokeCondition(expire);
|
||||||
var expire = timedTokens[0].Token;
|
|
||||||
if (self.TokenValid(expire))
|
|
||||||
self.RevokeCondition(expire);
|
|
||||||
|
|
||||||
timedTokens.RemoveAt(0);
|
timedTokens.RemoveAt(0);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user