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

Fixed Ship Search Overvaluing Ultra-Green Personnel #3990

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

IllianiCBT
Copy link
Collaborator

Current Implementation

AtB Ship Search currently uses a block of code to cycle through each logistics personnel, with a mind towards finding the best personnel skill rating among logistics personnel. It then uses this to apply a modifier to the Ship Search TN.

image image

Problem

The code already checks for highest skilled personnel using the findBestInRole() function. The loop that follows is unnecessary.

Furthermore, the loop includes broken logic that results in Ultra-Green personnel being rated higher than any other personnel.

Solution

I simply removed the excess code.

Testing

I tested personnel with both primary and secondary Admin/Logistics roles of all ranks.

...closes #3989

@IllianiCBT IllianiCBT self-assigned this Apr 10, 2024
@IllianiCBT IllianiCBT added the Bug label Apr 10, 2024
@IllianiCBT IllianiCBT changed the title Removed Unnecessary Code From AtB Ship Search Fixed Ship Search Overvaluing Ultra-Green Personnel Apr 10, 2024
@IllianiCBT IllianiCBT added the AtB label Apr 10, 2024
Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

LGTM!

Would it be difficult to add a unit test showing that this function no longer overvalues Ultra Green admins?

@IllianiCBT
Copy link
Collaborator Author

LGTM!

Would it be difficult to add a unit test showing that this function no longer overvalues Ultra Green admins?

Being perfectly honest, I have no idea where to even start with Unit Tests

@Sleet01
Copy link
Collaborator

Sleet01 commented Apr 15, 2024

LGTM!
Would it be difficult to add a unit test showing that this function no longer overvalues Ultra Green admins?

Being perfectly honest, I have no idea where to even start with Unit Tests

No worries, although now I think we might want to have a Unit Test page in the Wiki at some point.
It's basically just calling the changed code as locally (that is, as close to the change) as possible, with any required information or data mocked up or initialized so the code works as per normal.

@HammerGS HammerGS merged commit b7640a5 into MegaMek:master Apr 15, 2024
4 checks passed
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.

Ship Search TN
3 participants