Remove incorrect comment and merge nested conditionals.
This commit is contained in:
@@ -121,10 +121,7 @@ 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
|
|
||||||
if (timedTokens.Count > 0)
|
|
||||||
{
|
{
|
||||||
var expire = timedTokens[0].Token;
|
var expire = timedTokens[0].Token;
|
||||||
if (self.TokenValid(expire))
|
if (self.TokenValid(expire))
|
||||||
@@ -133,7 +130,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
timedTokens.RemoveAt(0);
|
timedTokens.RemoveAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var timedToken = new TimedToken(token, self, source, remaining);
|
var timedToken = new TimedToken(token, self, source, remaining);
|
||||||
var index = timedTokens.FindIndex(t => t.Expires >= timedToken.Expires);
|
var index = timedTokens.FindIndex(t => t.Expires >= timedToken.Expires);
|
||||||
|
|||||||
Reference in New Issue
Block a user