Well, I'm not quite sure how you want to use EffectList:Contains(), but my point is that
if (effectList:Contains(effect)) then
is probably not significantly more efficient than
if (effectIsPresent[effect]) then
where
effectIsPresent is a hash table that you have built with
effectList.EffectAdded = function(obj, args)local effect = obj:Get(args.Index);
effectIsPresent[effect] = true;
end
effectList.EffectRemoved = function(obj, args)local effect = obj:Get(args.Index);
effectIsPresent[effect] = false;
end
of course assuming that the "EffectRemoved" event is fixed in U24.
Note: I believe each instance of an effect has its own distinct object. So you can't create an Effect object for a given effect and use that for comparison to future instances of that effect.