Jump to content

inventoryitem_replica's CanBePickedUp `doer` Parameter Causes Crash When nil (Since v657420)


Whateverr
  • Fixed

During an update six months ago, the CanBePickedUp method in inventoryitem_replica was modified to include a doer parameter. The original implementation contained safety checks through code like:

doer and doer:HasTag(restrictedtag)

which explicitly handled potential nil values, establishing the parameter as optional by design.

However, in the current version (657420), the following problematic code was introduced:

image.png.d77e6e7e0cba1a871ab87eaf0fa4b8ef.png

This new implementation makes a dangerous assumption that doer is always non-nil, resulting in game crashes when doer is absent.

BTW, in prefabs/mole.lua (line 112), we find explicit proof of this parameter's optional nature:

image.png.8206315eaa9a16bf28a4ac708e1e1c1b.png

Overall, this seems like a very simple issue, but I'm worried that it might not be fixed simply by adding an additional nil check. However, the problem does exist, and I hope it can be fixed.


Steps to Reproduce

as mentioned above

  • Like 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...