Opened 10 years ago

Closed 9 years ago

Last modified 6 years ago

#2627 closed defect (fixed)

[PATCH] When garrisoning a hero, the selection ring is not cleared

Reported by: mimo Owned by: Stan
Priority: Nice to Have Milestone: Alpha 18
Component: UI & Simulation Keywords:
Cc: Patch:

Description

The hero ring is not cleared when garrisoning it, so it stays at the last position occupied by the hero before being put out of world.

Attachments (5)

2627.1.diff (1.3 KB ) - added by Stan 9 years ago.
Fix, Sorry, uploaded to wrong ticket first.
2627.2.diff (1.3 KB ) - added by Stan 9 years ago.
Checks if CmpPosition is null.
2627.3.patch (1.7 KB ) - added by Stan 9 years ago.
Another one, Thanks to trompetin17 for support
2627.4.patch (1.6 KB ) - added by Stan 9 years ago.
Another One, without handle.
2627.diff (719 bytes ) - added by trompetin17 9 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by leper, 9 years ago

#2911 was a duplicate of this.

comment:2 by Stan, 9 years ago

Keywords: review patch added
Owner: set to Stan
Summary: When garrisoning a hero, the selection ring is not cleared[PATCH] When garrisoning a hero, the selection ring is not cleared

by Stan, 9 years ago

Attachment: 2627.1.diff added

Fix, Sorry, uploaded to wrong ticket first.

comment:3 by leper, 9 years ago

cmpPositon can be null and you should verify that. (Not sure if this is the best place to handle this, but I haven't looked at that code for some time.

comment:4 by Stan, 9 years ago

Should I check before the current check or at the same time is fine ?

comment:5 by leper, 9 years ago

When you use it, but make sure to adjust the code in case it is null. (!cmpPosition || cmpPosition->IsInWorld())

by Stan, 9 years ago

Attachment: 2627.2.diff added

Checks if CmpPosition is null.

comment:6 by Itms, 9 years ago

Keywords: review removed

Your patch should be made differently. Indeed, you can't request Position in Selectable's Init because the order of component creation is unknown.

In my opinion, you should fix it that way: listen to PositionChanged messages and when you receive one, if the entity has a permanent selection ring, if it is in the world, display the overlay, else remove it.

Thanks for working on it :)

comment:7 by Stan, 9 years ago

Then I dońt know how to do it :-/

by Stan, 9 years ago

Attachment: 2627.3.patch added

Another one, Thanks to trompetin17 for support

by Stan, 9 years ago

Attachment: 2627.4.patch added

Another One, without handle.

by trompetin17, 9 years ago

Attachment: 2627.diff added

comment:8 by Stan, 9 years ago

Keywords: review added

comment:9 by Itms, 9 years ago

Resolution: fixed
Status: newclosed

In 16274:

Fix hero selection ring not cleared when the unit goes out of the world (when garrisoning for instance).

Patch by trompetin17, fixes #2627.

comment:10 by Itms, 9 years ago

Keywords: patch review removed
Milestone: BacklogAlpha 18

Thanks for the patch!

comment:11 by temple, 6 years ago

In 21241:

Fix selection rings while garrisoning

Differential Revision: https://code.wildfiregames.com/D1158
Reviewed by: elexis, Itms
Refs: #2627

Note: See TracTickets for help on using tickets.