Update
This commit is contained in:
@@ -45,9 +45,9 @@ namespace Continentis.MainGame
|
||||
|
||||
public partial class BuffBase<T>
|
||||
{
|
||||
protected bool FindExistingSameBuff<T1, T2>(out T2 existingBuff, List<T1> buffList) where T1 : BuffBase<T> where T2 : BuffBase<T>
|
||||
protected bool FindExistingSameBuffs<T1, T2>(out List<T2> existingBuffs, List<T1> buffList) where T1 : BuffBase<T> where T2 : BuffBase<T>
|
||||
{
|
||||
existingBuff = null;
|
||||
existingBuffs = new List<T2>();
|
||||
//Debug.Log($"Searching for existing buff of type: {this.GetType()} in buff list of count: {buffList.Count}");
|
||||
foreach (T1 buff in buffList)
|
||||
{
|
||||
@@ -55,9 +55,8 @@ namespace Continentis.MainGame
|
||||
if (buff.GetType() == this.GetType())
|
||||
{
|
||||
//Debug.Log("Found existing buff of the same type.");
|
||||
existingBuff = buff as T2;
|
||||
existingBuffs.Add(buff as T2);
|
||||
//Debug.Log(existingBuff == null);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -65,7 +64,7 @@ namespace Continentis.MainGame
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return existingBuffs.Count > 0;
|
||||
}
|
||||
|
||||
public abstract void Apply(T attached);
|
||||
|
||||
Reference in New Issue
Block a user