Fix doubleclicking if the unit died between the clicks following 8f36ca47a1, refs #4414, https://code.wildfiregames.com/D326

Differential Revision: https://code.wildfiregames.com/D469
Patch By: causative
This was SVN commit r19583.
This commit is contained in:
elexis
2017-05-15 11:51:01 +00:00
parent a73d59720e
commit 1eae8d0a95
@@ -968,8 +968,10 @@ function handleInputAfterGui(ev)
{
if (clickedEntity == INVALID_ENTITY)
clickedEntity = Engine.PickEntityAtPoint(ev.x, ev.y);
if (clickedEntity == INVALID_ENTITY)
// Abort if we didn't click on an entity or if the entity was removed before the mousebuttonup event.
if (clickedEntity == INVALID_ENTITY || !GetEntityState(clickedEntity))
{
clickedEntity = INVALID_ENTITY;
if (!Engine.HotkeyIsPressed("selection.add") && !Engine.HotkeyIsPressed("selection.remove"))
{
g_Selection.reset();