Windfisch / factorio-bot

Work-in-progress factorio bot
GNU General Public License v3.0
33 stars 4 forks source link

CraftingActions get deleted too early, no claim possible #22

Closed Windfisch closed 6 years ago

Windfisch commented 6 years ago

When a CraftingAction has finished, it is deleted immediately in main.cpp. One frame later, the Inventory update arrives and can't find the owner. Therefore, it cannot add the appropriate claim, the crafted item becomes free-for-all.

Possible fix: let the Task store a pointer to these CraftingActions. Or maintain a actionid -> owner_id mapping, without the weak_ptr<PrimitiveAction> in between