5 override bool ShouldContainerChangeCauseUpdate()
13 int containerComparePosition;
14 float containerCompareResource;
15 float containerCompareMaxResource;
16 float containerCompareNorm;
19 int maxPosition = GetUpperOffsetPosition();
20 float containerResource = container.GetResourceValue();
21 float containerMaxResource = container.GetMaxResourceValue();
24 if (containerResource == containerMaxResource)
25 return maxPosition - m_iOffsetPosition;
27 float containerNorm = vector.DistanceSq(actor.GetOwnerOrigin(), container.GetOwnerOrigin());
32 containerCompare = GetContainerAt(containerComparePosition);
34 if (!containerCompare)
36 maxPosition = containerComparePosition;
40 containerCompareResource = containerCompare.GetResourceValue();
41 containerCompareMaxResource = containerCompare.GetMaxResourceValue();
42 containerCompareNorm = vector.DistanceSq(actor.GetOwnerOrigin(), containerCompare.GetOwnerOrigin());
44 if (containerNorm > containerCompareNorm)
45 position = containerComparePosition + 1;
47 else if (containerNorm < containerCompareNorm)
48 maxPosition = containerComparePosition;
50 else if (containerResource > containerCompareResource)
51 position = containerComparePosition + 1;
53 else if (containerResource < containerCompareResource)
54 maxPosition = containerComparePosition;
56 else if (containerMaxResource > containerCompareMaxResource)
57 position = containerComparePosition + 1;
59 else if (containerMaxResource < containerCompareMaxResource)
60 maxPosition = containerComparePosition;