Description

A user pointed out a possible mistake in the Engine source code. In the GetCollisionShape function in the UPrimitiveComponent class, an FVector variable Extent is created and set, and then potentially modified to make sure it is not smaller than zero size. However, this variable is never actually used.

Looking over the code, I suspect that it is intended for the return line to be return FCollisionShape::MakeBox(Extent);

Edit Tim L
========
Another user voiced the concern that the if statement in the function should be checking Extent instead of the float value that is passed into the function. This should only be a concern if we do not check Bounds.BoxExtent anywhere else to make sure it never contains a negative value. From what I can tell, this value should default to ZeroVector, but I could not find anything that would make sure none of the values were ever set to a negative value.

Steps to Reproduce
  1. Open the PrimitiveComponent.cpp file in the source code.
  2. Locate the GetCollisionShape function.
    • In CL-2736016 it is located at line 1394.

RESULT:
The Extent variable is created and set, but never used.

EXPECTED:
The Extent variable is used.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Fixed
ComponentUE - Gameplay
Affects Versions4.9.24.11
Target Fix4.11
Fix Commit2737180
Main Commit2765024
CreatedOct 21, 2015
ResolvedOct 21, 2015
UpdatedApr 27, 2018