Flat collectors DO harvest crops, but the farm detection ray is being cast at a 90 degree angle.

Chris Bode shared this bug 8 hours ago
Submitted

Flat collectors look for crops to harvest in the wrong direction.

This is probably related to the previous issue flat collectors had with a rotated collection hit box. The item collection hitbox is now correct, but the farm detection ray is being cast in the wrong direction.

BuildInfo correctly shows the improper farm detection angle.

I have recorded an example of the behavior in a completely unmodded save.

Video Link

The save from the video is attached.

Poking at the game's IL, Sandbox.Game.Entities.Blocks.MyCollector.UpdateBeforeSimulation100 is hardcoded to use m_collectorDummyMatrix.Forward for the farm detection ray. This is correct for the other two collectors, but the flat collector is oriented such that the business end points along the "Up" vector.

Replies (1)

photo
1

Unless I'm missing something with regards to the coordinate systems involved here, it seems a trivial fix would be to replace

Vector3D.Normalize(Vector3D.TransformNormal(m_collectorDummyMatrix.Forward, base.WorldMatrix));
with

Vector3D.Normalize(Vector3D.TransformNormal(m_collectorDummyMatrix.Translation, base.WorldMatrix));


as all collectors' detector_collector dummies have translations in the direction the farm detection ray should be cast, and you're already normalizing the result as it is.

photo
1

Assuming it isn't simpler just to remake the asset with a properly transformed detector dummy.

photo
Leave a Comment
 
Attach a file