New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requires<> is bogus. #10907
Comments
To enforce this, you just need to strengthen the rules: This line determines which traits met their requirements. Currently if one or more dependencies are present to satisfy a dependant, that is sufficient. You are asking for all of the dependencies to be listed before the dependant. This can be achieved with an extra condition: var more = unresolved.Where(u => u.Dependencies.All(d =>
resolved.Exists(r => testResolve(d, r.Type)) &&
!unresolved.Any(u1 => testResolve(d, u1.Type)))); // This condition here. This causes some mods to fail to load though, as they can't meet this constraint. In both cases, This probably indicates the existing setups for these mods are somewhat kinda buggy, but until they are fixed I'm not sure what to do about them. This indicates this issue is probably not a regression, though it is perhaps a bug. D2k
due to public class WithDecorationCarryableInfo : WithDecorationInfo { }
public class WithDecorationInfo : UpgradableTraitInfo { }
public abstract class UpgradableTraitInfo : IUpgradableInfo { } RA
due to public abstract class AttackBaseInfo : UpgradableTraitInfo { }
public abstract class UpgradableTraitInfo : IUpgradableInfo { } |
It wasn't me who claimed this being a regression but @pchote - http://logs.openra.net/?year=2016&month=03&day=09#12:14:03. In both of your example cases I'd put the blame on other traits: |
I agree that the current behaviour seems like a bug - but it seems like we'll need to work out a fix for the default mods first. Something like #8848 might be needed for that though. Blugh. |
I haven't thought this through fully, but perhaps we can resolve the circular dependency in If that's feasible, that would seem to incur the least amount of work.. |
As my recent modding experiments uncovered it,
Requires<>
turned out to be bogus. If the required trait has multiple instances on the actual actor and the trait which is required is placed between them,Requires<>
will not force the followup instances to be loaded before the trait which requires them.Testcase in bleed TS: add
AutoTarget
between the twoAttack*
traits to the Tick Tank (ttnk
). The game won't crash. Add it to the end of the unit and the game will crash due toAutoTarget
is still incapable of handling moreAttack*
traits.AutoTarget
requiresAttackBase
.The text was updated successfully, but these errors were encountered: