Menu

#3788 Artillery To-hit adjusted sprites not being drawn

stable 0.36
closed
None
fixed
3
2013-07-25
2013-07-20
No

When I made fixes to the code to draw artillery relates sprites, I introducted a bug. This is related to ticket [#3784].

There are three possible types of sprites: incoming artillery fire, artillery fire auto-hit, and artillery to-hit adjusted. These adjustments come from "zeroing in": if the artillery hits the intended hex, that hex becomes an auto-hit hix from then on, if the artillery misses and there's a spotter then the to-hit is adjusted by -1. The drawing of these adjusted sprites was broken by the code to fix ticket [#3784].

Related

Bugs: #3784

Discussion

  • Nicholas Walczak

    This was fixed in [r9630]. The issue is that, the sprites that weren't being drawn are stored on a per-entity basis. My recent code was setup to draw auto-hit hexes on a per-player basis. The code was updated so that the per-player auto-hix designated hexes are still drawn, but now there's additional code to draw the per-unit sprites if the proper unit/weapon is selected in the mech view.

    I also started using the localPlayer state variable in BoardView1 and I found that it wasn't being updated properly. During the phase change event in ClientGui, it is updated but only if the boardview localplayer is null. If a /reset command is issue, the local player will change, however since the value in BoardView1 isn't null, it won't get updated. I replaced the null check with an address-based comparison between the board view local player and the client local player. If they differ, the boardview value is updated.

     

    Related

    Commit: [r9630]

  • Nicholas Walczak

    • Resolution: accepted --> fixed
     
  • Nicholas Walczak

    Ah, I also had to adjust the scope of some things within ArtilleryTracker. I had to change a method from protected to public, and I also had to change the static nested class ArtilleryModifier to public. This allows me to write more efficient rendering of the sprites for the modifiers. Before these changes, I could only get modifiers given a weapon,coords pair, now I can get all the modifiers for one particular weapon.

     
  • Sebastian Brocks

    • Status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB