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

Throw a more detailed error message when creating invalid frozen actors #13155

Merged
merged 2 commits into from May 28, 2017

Conversation

Projects
None yet
4 participants
@abcdefg30
Member

abcdefg30 commented Apr 19, 2017

Before it crashed with an exception like this:

Exception of type `System.ArgumentException`: Bounds of actor concreteb 38 (invalid) are empty.
Parametername: bounds

I think this error message is more helpful, as it immediately tells you that FrozenUnderFog is part of the problem, so that you can decide if you either remove that or fix the bounds of the actor.

@pchote

I think the best way to do this would be to implement RulesetLoaded on the FrozenUnderFogInfo and then throw a YamlException if the actor info doesn't include SelectableInfo or IAutoSelectionSizeInfo (which you'll need to define and attach to traitinfos that use IAutoSelectionSize).

This will make the linter catch the error instead waiting for game runtime.

@abcdefg30

This comment has been minimized.

Show comment
Hide comment
@abcdefg30

abcdefg30 May 11, 2017

Member

Updated.

Member

abcdefg30 commented May 11, 2017

Updated.

@abcdefg30

This comment has been minimized.

Show comment
Hide comment
@abcdefg30

abcdefg30 May 17, 2017

Member

Fixed.

Member

abcdefg30 commented May 17, 2017

Fixed.

@pchote

This comment has been minimized.

Show comment
Hide comment
@pchote

pchote May 25, 2017

Member

OpenRA.Mods.Cnc/Traits/Render/WithVoxelWalkerBody.cs:L25: [SP2100] Code line must be no longer than 180 characters (now 181).

Member

pchote commented May 25, 2017

OpenRA.Mods.Cnc/Traits/Render/WithVoxelWalkerBody.cs:L25: [SP2100] Code line must be no longer than 180 characters (now 181).

@abcdefg30

This comment has been minimized.

Show comment
Hide comment
@abcdefg30

abcdefg30 May 26, 2017

Member

Fixed, thanks.

Member

abcdefg30 commented May 26, 2017

Fixed, thanks.

{
[Desc("Players with these stances can always see the actor.")]
public readonly Stance AlwaysVisibleStances = Stance.Ally;
void IRulesetLoaded<ActorInfo>.RulesetLoaded(Ruleset rules, ActorInfo info)

This comment has been minimized.

@rob-v

rob-v May 26, 2017

Contributor

In all other places except one the interface isn't implemented explicitly (IRulesetLoaded...).

@rob-v

rob-v May 26, 2017

Contributor

In all other places except one the interface isn't implemented explicitly (IRulesetLoaded...).

This comment has been minimized.

@abcdefg30

abcdefg30 May 27, 2017

Member

IIRC the aim is to have all interfaces explicit sooner or later (see #10143), so I always try to make all interface implementations I touch/add explicit.

@abcdefg30

abcdefg30 May 27, 2017

Member

IIRC the aim is to have all interfaces explicit sooner or later (see #10143), so I always try to make all interface implementations I touch/add explicit.

Show outdated Hide outdated OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs
@rob-v

rob-v approved these changes May 27, 2017

@reaperrr reaperrr merged commit aecfff9 into OpenRA:bleed May 28, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@abcdefg30 abcdefg30 deleted the abcdefg30:screenMap branch May 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment