Skip to content
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

Made MapBuildRadius optional for traits who do not require it. #15366

Merged
merged 1 commit into from Jul 25, 2018

Conversation

Projects
None yet
4 participants
@IceReaper
Copy link
Contributor

IceReaper commented Jul 22, 2018

MapBuildRadius is used to add checkboxes to lobby to alter standard behavior. However when this trait is removed, the game crashes. With this changes, default values are used if the trait is not enabled.

@GraionDilach
Copy link
Contributor

GraionDilach left a comment

👍

buildRadiusEnabled = mapBuildRadius.BuildRadiusEnabled;
var mapBuildRadius = self.World.WorldActor.TraitOrDefault<MapBuildRadius>();
allyBuildEnabled = mapBuildRadius == null || mapBuildRadius.AllyBuildRadiusEnabled;
buildRadiusEnabled = mapBuildRadius == null || mapBuildRadius.BuildRadiusEnabled;

This comment has been minimized.

@pchote

pchote Jul 25, 2018

Member

IMO it would make more sense to default both of these to false if the trait isn't defined. Likewise in Building.

This comment has been minimized.

@IceReaper

IceReaper Jul 25, 2018

Author Contributor

Makes sense. Ill change that.

@IceReaper IceReaper force-pushed the IceReaper:optional_mapbuildradius branch from 59929f4 to 1e61cf5 Jul 25, 2018

@GraionDilach

This comment has been minimized.

Copy link
Contributor

GraionDilach commented Jul 25, 2018

Still 👍

@pchote

pchote approved these changes Jul 25, 2018

@pchote pchote merged commit b86355c into OpenRA:bleed Jul 25, 2018

2 checks passed

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

@IceReaper IceReaper deleted the IceReaper:optional_mapbuildradius branch Jul 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.