Menu

#4561 NPE When Using Remove button in Deploy phase

stable 0.42
closed
None
fixed
1
2015-08-05
2015-06-08
No

Went to reinforce a game in progress, but wound up with duplicates in my reinforcements. Tried using "Remove Unit" to pare away the excess, but I wound up where the game was expecting me to deploy additional units, but I had removed all the remaining units to deploy. Log and Save attached.

3 Attachments

Discussion

  • Nicholas Walczak

    • assigned_to: Nicholas Walczak
    • Resolution: none --> accepted
    • Milestone: undetermined --> stable 0.42
     
  • Nicholas Walczak

    This bug can happen whenever using the "Remove" button during deploy and the player is deploying multiple units.

     
  • Nicholas Walczak

    • summary: NPE When Reinforcing/Remove Last Unit --> NPE When Using Remove button in Deploy phase
     
  • Nicholas Walczak

    Fixed in [r11961].

    There were two issues here, the first of which was in DeploymentDisplay, which was covering up the issue in Server.receiveEntityDelete. In DeploymentDisplay.remove(), DeploymentDisplay.beginMyTurn() was being called, which basically started a new turn for the Entity that was just removed. It sets the current entity in DeploymentDisplay to an Entity that is shortly removed by the Server, so when you click the Remove button, it tries to remove an Entity that doesn't exist. There's no reason for DeploymentDisplay.remove() to call beginMyTurn. Instead, it just needs to set cen (the current entity Id), to Entity.NONE.

    Secondly, Server.receiveEntityDelete was changed a while back to handle a list of Entitys. When this happened, it was setup to inform the client of a turn change before notifying the Client that the Entity was deleted. I adjusted this order. (Otherwise the Client would try to start a turn for an Entity that could potentially get deleted).

     

    Related

    Commit: [r11961]

  • Nicholas Walczak

    • Resolution: accepted --> fixed
     
  • Dylan Myers

    Dylan Myers - 2015-08-05
    • Status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB