#4013 closed defect (fixed)
Defeating players twice
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 21 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: |
Description
It obviously shouldn't be possible to defeat a player twice or win a game after being defeated and the like.
However due to the fact of defeating players by broadcasting a message PlayerDefeated
, there have been several bugs already that caused duplicate defeats like #3193, ticket:2976#comment:6 or #4010. That however didn't result in fixing this in the simulation.
Instead of broadcasting a message when wanting to ensure that a player is defeated, the simulation should just use a function of the Player
-component to defeat a player, abort if the player is not active anymore and only then broadcast the message.
Furthermore we send a PlayerDefeated
message but not a PlayerWon
message, which is not only inconsistent but also prevents components from subscribing to this event.
That further messed up the GUI code. For example there are messages for players that were defeated but it doesn't show who won.
The checkPlayerState()
function which is called onTick
while it should only be called when the sim actually broadcasted a PlayerDefeated
or PlayerWon
message.
Change History (2)
comment:1 by , 8 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:2 by , 8 years ago
Milestone: | Backlog → Alpha 21 |
---|
In 18441: