| Time |
Nick |
Message |
| 04:00 |
|
MTDiscord joined #luanti-dev |
| 04:06 |
|
Alias joined #luanti-dev |
| 04:43 |
|
SFENCE joined #luanti-dev |
| 05:59 |
|
SFENCE joined #luanti-dev |
| 07:25 |
|
YuGiOhJCJ joined #luanti-dev |
| 07:26 |
|
YuGiOhJCJ joined #luanti-dev |
| 07:44 |
|
SFENCE joined #luanti-dev |
| 08:19 |
|
SFENCE joined #luanti-dev |
| 08:22 |
|
Warr1024 joined #luanti-dev |
| 08:47 |
|
Warr1024 joined #luanti-dev |
| 12:11 |
|
SFENCE joined #luanti-dev |
| 13:28 |
|
pmp-p joined #luanti-dev |
| 13:51 |
|
SFENCE joined #luanti-dev |
| 14:23 |
|
alek13 joined #luanti-dev |
| 14:26 |
|
MTDiscord1 joined #luanti-dev |
| 14:52 |
|
SFENCE joined #luanti-dev |
| 15:56 |
|
panwolfram joined #luanti-dev |
| 16:20 |
|
panwolfram joined #luanti-dev |
| 16:48 |
|
panwolfram joined #luanti-dev |
| 17:49 |
|
MTDiscord2 joined #luanti-dev |
| 18:15 |
|
crazylad joined #luanti-dev |
| 18:15 |
|
crazylad joined #luanti-dev |
| 19:20 |
|
YuGiOhJCJ joined #luanti-dev |
| 19:43 |
Krock |
huh... item_OnDrop returns an empty ItemStack |
| 19:45 |
Krock |
ah because it successfully dropped 1/1 count |
| 19:47 |
sfan5 |
yeah got a big confused there too |
| 19:47 |
sfan5 |
I'm currently debugging this |
| 19:49 |
sfan5 |
hmm yeah I forgot about this case |
| 19:50 |
sfan5 |
"on_drop can return any arbitrary item" doesn't really work when dropping a single item. because there will be (potentially) two results to put back |
| 19:53 |
|
crazylad joined #luanti-dev |
| 19:54 |
Krock |
my WIP so far https://pastebin.com/raw/FVKhMzAP |
| 19:54 |
Krock |
if the returned item1 does not stack with src_item, it should be added to the inventory or dropped forcefully |
| 19:55 |
Krock |
otherwise add to src_item |
| 20:02 |
sfan5 |
maybe reverting the flexibility would be easier... |
| 20:08 |
Krock |
sfan5: my proposal: https://pastebin.com/raw/64g1MhtA |
| 20:08 |
Krock |
not sure if addItem would need to go into the branch above |
| 20:10 |
Krock |
actually it should go into `if (src_can_take_count != -1)` above to avoid unintended side-effects of filling creative inventories (because addItem runs no callback) |
| 20:13 |
Krock |
also the *_OnTake calls below need to be adjusted. 'src_item' is misleading in this case. We actually want to report how many items the player wanted to drop, which would be a backup of 'item1' |
| 20:14 |
Krock |
or (original_src_item - src_item) |
| 20:16 |
sfan5 |
I'd rather revert it actually |
| 20:43 |
Krock |
okay I'd have a counter-proposal. Shall I PR, or would you like to revert directly? |
| 20:45 |
sfan5 |
feel free to PR |
| 20:45 |
sfan5 |
I'll PR the revert |
| 20:52 |
Krock |
#17023 for those who might want to give it a shot |
| 20:52 |
ShadowBot |
https://github.com/luanti-org/luanti/issues/17023 -- Inventory: Fix item loss caused by itemstack dropping by SmallJoker |
| 21:05 |
|
SFENCE joined #luanti-dev |
| 21:24 |
sfan5 |
i guess I could write an unittest tomorrow too |
| 21:32 |
|
SFENCE joined #luanti-dev |
| 21:37 |
sfan5 |
on_drop should have been (itemstack, dropper, count_to_drop) -> new_itemstack from the start |
| 21:37 |
sfan5 |
then this would have worked |
| 21:37 |
sfan5 |
and lua can deal with the problem if it wants to do both 1. drop a single item and 2. change the original stack |
| 21:37 |
|
SFENCE joined #luanti-dev |
| 21:57 |
|
SFENCE joined #luanti-dev |
| 22:43 |
|
[ joined #luanti-dev |
| 23:12 |
|
SFENCE joined #luanti-dev |
| 23:19 |
|
AliasAlreadyTake joined #luanti-dev |
| 23:34 |
|
panwolfram joined #luanti-dev |
| 23:52 |
|
SFENCE joined #luanti-dev |