[0.12.5] LuaEntity.logistic_network function/value
Posted: Sun Aug 30, 2015 1:38 pm
Started messing with the new LogisticNetwork/Cell API and found either a bug or a mistake in the Wiki for LuaEntity
WIki says LuaEntity.logistic_network is the network the entity is in or nil.
Trying it in code, with the entity being a (modded) wooden chest it complained being a function when i tried to get the item count of an item in the network.
I then tried using it as a function with sth. like
Tried different parameters; surface.name, surface/force only etc. Resulting in LuaEntity doesn't contain player (or nauvis if using surface.name)
WIki says LuaEntity.logistic_network is the network the entity is in or nil.
Trying it in code, with the entity being a (modded) wooden chest it complained being a function when i tried to get the item count of an item in the network.
Code: Select all
local logisticsNetwork = origEntity.logistic_network
--snip
logisticsNetwork.get_item_count(module) > 0 -- error here (and crash afterwards)
Code: Select all
local logisticsNetwork = origEntity.logistic_network(origEntity.position, origEntity.force.name)