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

Suffix projectile shadow palette with player name if IsPlayerPalette = true #19917

Merged

Conversation

darkademic
Copy link
Contributor

Missile, Bullet and GravityBomb allow you to set IsPlayerPalette is true, which suffixes the palette name with the player's internal name, however this isn't applied to the shadow palette, which means it'll use the base name. It's possible a palette with the base name doesn't exist while a player suffixed one does, which will result in an exception.

The shadow palette was previously defined separately so won't have been an issue.

These changes just make the shadow use the same palette name as the projectile itself so it's consistent.

@darkademic darkademic force-pushed the pr/projectile-shadow-palette-fix branch from 960900e to 146c71d Compare February 1, 2022 13:18
@@ -287,21 +287,18 @@ public IEnumerable<IRenderable> Render(WorldRenderer wr)
var world = args.SourceActor.World;
if (!world.FogObscures(pos))
{
var palette = wr.Palette(info.Palette + (info.IsPlayerPalette ? args.SourceActor.Owner.InternalName : ""));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs remain

Suggested change
var palette = wr.Palette(info.Palette + (info.IsPlayerPalette ? args.SourceActor.Owner.InternalName : ""));
var paletteName = info.Palette;
if (paletteName != null && info.IsPlayerPalette)
paletteName += args.SourceActor.Owner.InternalName;
var palette = wr.Palette(paletteName);

otherwise we're effectively reverting #19476!
(And we might want to adapt the other cases to use the same.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! Yea missed that null check, will change.

@darkademic darkademic force-pushed the pr/projectile-shadow-palette-fix branch from 146c71d to 6a55a60 Compare February 1, 2022 17:52
@abcdefg30 abcdefg30 merged commit 257ef95 into OpenRA:bleed Feb 6, 2022
@abcdefg30
Copy link
Member

Changelog

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

Successfully merging this pull request may close these issues.

None yet

3 participants