Closed whompratt closed 7 months ago
As a suggested fix, maybe the following:
@export var protoset: ItemProtoset :
set(new_protoset):
...
if _inventory != null && protoset != null:
return
....
This would stop manual editing of the protoset still (which I think is the desired goal), but would allow the item's protoset to be set outright.
Looks like this bug has been introduced in a recent refactoring. I think it should be fixed now (20d3eb00771c15a5b2f36a0f8ccfab8497b84ab6).
In the gloot documentation, one of the ways to add an item to an inventory is described as follows:
However, adding an item this way encounters an issue wherein the protoset for said item isn't updated. I believe this is because in 'inventory_item.gd', the following is present in the var setter:
Because of this, the following code doesn't execute:
This means you can't manually update the protoset and get an error when
had_prototype
is called on the item.