-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
LayMines: fixed occasional incorrect mine position when using BeginMinefield order #20968
Conversation
9ae0bdf
to
491f8bb
Compare
Sorry, I don't understand the fix. It has nothing to do with |
Please also add a comment in-code explaining the fix |
It does. There are two scenarios:
In the first one, the mine is laid immediately (on line 107):
In the second one, the mine laying is delayed by queuing
These both scenarios end the tick by returning
(Thus the code for picking next cell (after the main Now when the delay (in the second scenario) finishes, the mine is laid. In bleed version, the cause of the bug is that the tick is not ended, when the mine is laid:
By "laying a mine" I mean the stuff that
As a result the
Since Another possible fix could be to store current minelayer's location (to a temporary variable that will be captured for the lambda) before scheduling
|
Tbh the situation feels highly improbable. How can move activity change location without even running? |
Move activity only sets |
I see, Activity has a way to immediately tick child activity
In that case I'd prefer this fix
|
Are you sure? To me it seems something like "corrupted state": when FrameEndTask for creating mine (in |
You could create the actor on Tick, but only add it to world on Though giving it more thought, the current solution is fine. An improvement on it would be adding a check on FrameEndTask to see if mine still can be placed |
91ddaf3
to
e720e4a
Compare
…nefield order When laying mine with PreLayDelay > 0, end activity's tick immediately. That means don't try to immediately move to next cell. This change unifies the behavior with scenario when a mine is laid without any PreLayDelay.
When laying mine with
PreLayDelay > 0
, end activity's tick immediately. That means don't try to immediately move to next cell.This change unifies the behavior with scenario when a mine is laid without any
PreLayDelay
.