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

temporary fix DropPodManager.cs #49

Closed
wants to merge 1 commit into from

Conversation

drzsda
Copy link

@drzsda drzsda commented Mar 16, 2024

#47

Copy link
Collaborator

@InfinitySamurai InfinitySamurai left a comment

Choose a reason for hiding this comment

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

Thank you so much for putting this together, people have been asking me about this for a long time! Small comment I'd like addressed before I merge it 😄

if (showMessage)
{
string messageString = "RimConnectionPositiveDroppodMailBody".Translate(amount, title, desc);
AlertManager.ResourceDropNotification(messageString, dropVector);
AlertManager.ResourceDropNotification(messageString, dropVector ?? DropCellFinder.TradeDropSpot(Find.CurrentMap));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is going to instantiate a new dropcell compared to the one that you fallback to on line 18. I'd suggest getting the variable dropVector to be a definite value, i.e. do the dropVector ?? DropCellFinder.TradeDropSpot(Find.CurrentMap) before dropping or writing the messages

Copy link
Author

Choose a reason for hiding this comment

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

The meaning of this code was in safety and returning to old behavior in case the TryFindSafeLandingSpotCloseToColony method will return null, in theory this is possible, and I decided to play it safe. But in principle, this is not necessary.

Copy link
Collaborator

@InfinitySamurai InfinitySamurai Mar 17, 2024

Choose a reason for hiding this comment

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

The function signature didn't seem to say it could return null and looks like it already falls back to "Can't find spot, dropping stuff randomly on the map". All good 😄, thank you very much for the PR . I gave it a good test and it works great


if (showMessage)
{
string messageString = "RimConnectionPositiveDroppodMailBody".Translate("", title, desc);
AlertManager.ResourceDropNotification(messageString, dropVector);
AlertManager.ResourceDropNotification(messageString, dropVector ?? DropCellFinder.TradeDropSpot(Find.CurrentMap));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto previous comment

@InfinitySamurai
Copy link
Collaborator

Thank you again for putting this branch up, I used what you wrote here and made some tweaks over in PR #50

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

Successfully merging this pull request may close these issues.

2 participants