SelectionDrawer uses incorrect position for Things

Started by mipen, May 09, 2015, 07:38:21 AM

Previous topic - Next topic

mipen

Not sure if this is the appropriate place to post this, but the SelectionDrawer class uses the wrong position to draw the selection bracket around things in method DrawSelectionBracketFor:


Vector3 vector = thing.TrueCenter();
Pawn pawn = thing as Pawn;
if (pawn != null)
{
vector = pawn.drawer.DrawPos;
}


I believe this should instead look like:


Vector3 vector = thing.DrawPos;
Pawn pawn = thing as Pawn;
if (pawn != null)
{
vector = pawn.drawer.DrawPos;
}


because DrawPos returns the thing's TrueCentre, but it is also overridable, which would allow for moving selection brackets on things other than just pawns.

The reason I am bringing this up is that I am making a moving thing, but the selection brackets are drawn at each IntVec3 instead of the calculated Vector3

It could even omit the pawn section completely, as Pawn.DrawPos returns drawer.DrawPos anyway

Tynan

Tynan Sylvester - @TynanSylvester - Tynan's Blog