[0.10.9] Preplayermineditem called at the wrong time

This subforum contains all the issues which we already resolved.
Post Reply
Rseding91
Factorio Staff
Factorio Staff
Posts: 9856
Joined: Wed Jun 11, 2014 5:23 am
Contact:

[0.10.9] Preplayermineditem called at the wrong time

Post by Rseding91 » Sat Aug 30, 2014 5:35 pm

The preplayermineditem event isn't called at the right time; it's only called if the player mined a entity and was able to hold everything the item was holding instead of as the event name suggest: before the mining starts.

In two of my mods I use the "preplayermineditem" events to simulate picking up entities contents and all by storing the inventory contents onpreplayermineditem, emptying the entity inventory contents and then letting the game pick up the empty inventory (chest). When it gets placed back down later I use onbuilt to restore the inventory contents.

As it is now, the game empties the entire chest before calling onpreplayermineditem so it's always empty by the time the script sees it was mined.


What's expected:
  • Player mines entity: onpreplayermineditem is called
  • Standard inventory transfer of any items still in the chest are performed
  • If the inventory transfer was successful: onplayermineditem is called for the contents of the inventory
What happens:
  • Player mines entity:
  • Standard inventory transfer of any items in the chest are performed
  • If the inventory transfer was successful: onpreplayermineditem is called
  • onplayermineditem is called for the contents of the inventory
I don't know if this is so much a bug as it is a major change in how the events where processed.
If you want to get ahold of me I'm almost always on Discord.

kovarex
Factorio Staff
Factorio Staff
Posts: 7424
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.10.9] Preplayermineditem called at the wrong time

Post by kovarex » Wed Sep 10, 2014 12:43 pm

So it is fixed for 0.10.10

Post Reply

Return to “Resolved Problems and Bugs”

Who is online

Users browsing this forum: No registered users