unload_order.nut, called during caravan faction actions, doesn’t actually cause the receiving settlement to gain any new items. The problem is that the settlement isn’t found as an entity at the target position. This is fixed with a different function call.
Currently:
local entities = this.World.getAllEntitiesAtPos(_entity.getPos(), 1.0); // this only finds parties, not locations, the following condition can’t be true
Fixed:
local entities = this.World.getAllEntitiesAndOneLocationAtPos(_entity.getPos(), 1.0); //this also finds the settlement