SWY1985 / CivOne

An open source implementation of Sid Meier's Civilization.
http://www.civone.org/
Creative Commons Zero v1.0 Universal
244 stars 49 forks source link

Moving ship after activating carried unit disables unit's turn #310

Closed AlexFolland closed 7 years ago

AlexFolland commented 7 years ago

I had a Settlers unit in a Trireme unit. I clicked on the Trireme unit, then clicked on the Settlers unit in the window that appeared, activating the Settlers unit. I then decided that I did not want to make landfall yet, so I clicked the same unit stack and clicked the Trireme unit again. I moved the Trireme unit away until it had no more moves, then clicked the stack again, then the Settlers unit again, and I was not given control of the Settlers unit. I was given control of another unit. I used that unit's turn, then tried the Settlers unit on the Trireme stack, but it wouldn't let me use it. I had "End of Turn" enabled.

AlexFolland commented 7 years ago

I found a simple way to reproduce this, which is also a more common situation.

  1. Move 2 land units from a land tile onto a Trireme which is on an Ocean tile.
  2. End turn.
  3. Click the Trireme stack, then click each unit in the open window once.
  4. Attempt to move both units onto land.

The last unit clicked will be able to move, but the first one will not.

AlexFolland commented 7 years ago

I tried the exact steps above to reproduce this, but it did not happen this time. Both units were able to move. Did you change something that might relate to this?

SWY1985 commented 7 years ago

I have made several changes to the ship moves and land unit board/unboard code. It may be that I accidentally fixed this issue as well.

SWY1985 commented 7 years ago

Is this issue resolved?

AlexFolland commented 7 years ago

It seems to be, at least with Carrier and Bomber units, but I'm still not sure, as Bomber units don't have the "Sentry"/"Sleep" mode when they are on the Carrier units. I'll test with land units soon.

AlexFolland commented 7 years ago

No, it's not. I recorded a video of a full turn in which my Settlers units in my Transport unit were unable to move, but my Bomber unit in my Carrier unit was. There are 2 more related bugs visible in this video too: units "falling off" the boat, Bomber unit stacked with Carrier unit showing Bomber unit primarily instead of Carrier unit.

http://lex.clansfx.co.uk/requested/CivOneboatcarriedunitmovementbug.mkv

AlexFolland commented 7 years ago

I just experienced this again by having activated a Legion unit on the previous turn and not moving it off the boat. I was then unable to move it on the next turn. I think it has something to do with automatically going into "Sentry"/"Sleep" mode while in the boat, which is taking the unit's turn and preventing full activation.

SWY1985 commented 7 years ago

There's some code that prevents drawing land units at sea unless they're active. I assume this causes the boat to become invisible too. I'll fix this soon.

AlexFolland commented 7 years ago

You survived the flood! (of issues) Amazing work. From my experience playing through the game several times in the past few days, there are few major issues left. I dumped every issue I could find and you've fixed many of them as fast as I could report them. Great job!

SWY1985 commented 7 years ago

It's great being able to work together like this and knowing someone appreciates my work, so thank you very much for your invaluable help!