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

Fix subcells imported from Gen1 maps #21397

Merged
merged 1 commit into from Apr 30, 2024

Conversation

JovialFeline
Copy link
Contributor

@JovialFeline JovialFeline commented Apr 11, 2024

This should correct a minor issue with RA/CnC imports of infantry. The subcell number is copied as-is, though ORA's assignment for them is different.

new(0, 0, 0), // full cell - index 0
new(-299, -256, 0), // top left - index 1
new(256, -256, 0), // top right - index 2
new(0, 0, 0), // center - index 3
new(-299, 256, 0), // bottom left - index 4
new(256, 256, 0), // bottom right - index 5

Below, each number is the original subcell index. The SW corner becomes the center and a possible duplicate, while the SE corner replaces the SW one.

 Gen 1      Bleed Import

1     2      1       2
   0            0+3
3     4      4       _

The Gen2 importer has its own adjustments.

var subcell = 0;
switch (Exts.ParseByteInvariant(entries[5]))
{
case 2: subcell = 3; break;
case 3: subcell = 1; break;
case 4: subcell = 2; break;
}
if (subcell != 0)
ar.Add(new SubCellInit((SubCell)subcell));


I had seen odd subcells on occasion but hadn't dug into it until I noticed Soviets in allies-03 were less likely to be hidden by trees. That is something the enemy does fairly often in Tiberian Dawn as well.

allies-03-ra96

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

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

LGTM untested

Copy link
Contributor

@anvilvapre anvilvapre left a comment

Choose a reason for hiding this comment

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

Perhaps use an enum to indicate the direction/index. To avoid similar issues in future.

@JovialFeline
Copy link
Contributor Author

Perhaps use an enum to indicate the direction/index. To avoid similar issues in future.

Would you prefer that to a comment?

@PunkPun PunkPun merged commit 6c9e33b into OpenRA:bleed Apr 30, 2024
3 checks passed
@PunkPun
Copy link
Member

PunkPun commented Apr 30, 2024

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

4 participants