-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
There was a problem hiding this 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)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto previous comment
Thank you again for putting this branch up, I used what you wrote here and made some tweaks over in PR #50 |
#47