Author Topic: The Absorb Fleet Bug  (Read 1661 times)

0 Members and 1 Guest are viewing this topic.

Offline Steve Walmsley (OP)

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11644
  • Thanked: 20339 times
The Absorb Fleet Bug
« on: January 23, 2009, 11:41:45 AM »
I have finally figured out what is happening here. Until v4.0, please avoid using the Absorb Fleet movement order.

When I created the Join Fleet order, I created a function to which you would pass the Joining Fleet and the Destination Fleet and the function would move all the ships from the former to the latter. The JoinFleet function was called during the main MoveFleets function and the fleet currently carrying out orders was always the one passed as the Joining Fleet. The joining fleet wasn't deleted until later on in the parent MoveFleets function because parts of that function relied on the current fleet still being there (because almost all of the time it carried out a different order and wasn't going to be deleted). Confirmation that the current fleet could be deleted was passed by the JoinFleets function back to the MoveFleets function after it had checked things like outstanding shipyard tasks.

When I created the Absorb command, I simply called the JoinFleets function and reversed the fleet IDs that were passed to it. Now the current fleet was passed as the Destination Fleet and the fleet that was being absorbed (set on the Fleet window when the order was originally created) was passed as the Joining Fleet. This all worked well, or so it seemed. Unfortunately, I had forgotten that the MoveFleets function deleted the first Fleet ID passed to the JoinFleets function further on in its own code. Therefore the Absorb fleet order successfully moved the ships of the fleet to be absorbed into the current fleet and then deleted the current fleet - oops!

Steve
 

Offline sloanjh

  • Global Moderator
  • Admiral of the Fleet
  • *****
  • Posts: 2805
  • Thanked: 112 times
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2021 Supporter 2021 Supporter : Donate for 2021
Re: The Absorb Fleet Bug
« Reply #1 on: January 23, 2009, 09:28:55 PM »
Quote from: "Steve Walmsley"
Therefore the Absorb fleet order successfully moved the ships of the fleet to be absorbed into the current fleet and then deleted the current fleet - oops!

A friend told me many years ago that surgeons are trained to say "there!" rather than "oops!". :-)
John