soundmud / soundrts

A real-time strategy audio game
http://jlpo.free.fr/soundrts
Other
44 stars 32 forks source link

Selecting Units That Are Shared Among Squares because of Exit Blocking Does not Work Properly #76

Closed MatejGolian closed 8 years ago

MatejGolian commented 8 years ago

The way how units blocking exits are being shown in the user interface is great, but I'm sorry to say that I have found another bug that needs to be adressed. I can best explain this with the help of an example. Let's say you are on a square with 2 paths - one to the east and one to the west. Let's say the square is A2. Let's say you also have 2 peasants. If you send one peasant to block the path to the east and you send the other peasant to block the path to the west, selecting all peasants on the neighboring squares, A1 and A3, gives unexpected results. If you move to A2 and press D, 2 units are selected. So far it works just like expected. If you were to move to A1 or A3, you'd hear, that there is only 1 peasant on those squares. So far so good. But the problem starts once you press the D key on one of those squares. If you were to go to A3, for example, and press D, 2 peasants would be selected instead of only one. I'm sure this is because that one peasant is shared among 2 squares. If we take A3, the peasant is blocking the path to the west. If you were to order him to block the path to the east (the one with A4) and there wouldn't be any peasants on A4, pressing D would behave correctly. Hope it was understandable and hope it can be fixed. This seems to be true for all units and it affects south-north paths exactly in the same way.

soundmud commented 8 years ago

First of all, thanks for testing the development version! I could reproduce the bug too, and here is what is happening: strangely, the local grouping command (1, 2, 3, 4) uses the location of the first currently selected unit as a reference, instead of using the current square in the interface. Since the D command uses the local grouping command, it uses the actual location of the peasant in A2 instead of A3, and so every peasant in A2 is selected. Actually, the behavior of 1, 2, 3 and 4 is documented in the manual, so some player might be using this property: "To control all the units of the same type and in the same square than the current unit, press 1.".

Anyway, the manual is clear about D: "To control all the local peasants, press D.". So the grouping is supposed to use the current square as a reference. I'll try to fix that.

MatejGolian commented 8 years ago

Thanks, I haven't tested it so thoroughly, but as far as I can tell it works fine now.