[Res] [dev 2647] New item_has_been_looted bug

Continuing the discussion from Develop-2647 on Steam Latest:

[quote=“Albert, post:1, topic:17156, full:true”]
Bug Fixes

  • Fixed ‘item_has_been_looted’ error when trying to restock destroyed items.

[/quote]
Edit: seems it is a different bug that touches the same function.

Summary: Received error at start of new game in dev 2647, all hearthlings collecting and storing resources with exception of two who were just promoted.

Steps to reproduce: Have not yet reproduced successfully, occured <5 minutes into new game/

Expected Results: No error occurs with new game

Actual Results: Error appears, game appears to progress without issue.

Notes:
Error:

develop-2647 (x64)
std::logic_error: 'invalid reference in native get_id'
stack traceback:
	[C]: in function 'get_id'
	stonehearth/services/server/town/town.luac:179: in function 'item_has_been_looted'
	...tions/put_restockable_item_into_backpack_action.luac:4: in function 'should_pick_up_item'
	...tions/put_restockable_item_into_backpack_action.luac:25: in function 'pickup_item_off_ground_filter'
	...tions/put_restockable_item_into_backpack_action.luac:37: in function 'filter_fn'
	stonehearth/ai/actions/find_path_to_entity_type.luac:21: in function <stonehearth/ai/actions/find_path_to_entity_type.luac:21>
	[C]: ?
	[C]: in function 'start'
	stonehearth/services/server/ai/compound_action.luac:125: in function <stonehearth/services/server/ai/compound_action.luac:122>
	[C]: ?
	[C]: in function 'start'
	...
	[C]: ?
	[C]: in function 'start'
	stonehearth/services/server/ai/compound_action.luac:125: in function <stonehearth/services/server/ai/compound_action.luac:122>
	[C]: ?
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.luac:190: in function '_thread_main'
	stonehearth/services/server/threads/thread.luac:90: in function <stonehearth/services/server/threads/thread.luac:89>
	[C]: in function 'xpcall'
	stonehearth/services/server/threads/thread.luac:89: in function 'f'
	radiant/lib/env.luac:8: in function <radiant/lib/env.luac:8>

Attachments:
stonehearth.log (172.7 KB)
Save folder

Version and Mods: develop-2647 with debug tools, cookmod, silomod, and bea_small_changes insalled

System Information: Windows 10 Pro 64 | Intel Core i5-3360M | 16 GB system memory | Nvidia NVS 5400m

######Paging @Albert

@jomaxro - It looks like the stonehearth mod is still develop-2630 as the ‘item_has_been_looted’ function was renamed in 2647. Reinstalling or verifying the installation should fix, but how did this happen in the first place?

[Edit: This is just wrong. See below. There are actually 3 bugs that share this function and I was confused.]

Hey @Albert, are you asking me how the error occurred in the first place, or rhetorically asking about the stonehearth mod folder?

Oh crap. I’m talking about the bug I just fixed. It missed the build. Sorry for the confusion!

Well you just made me more confused…

Is my stonehearth.mod out of date?

  1. Your mod should be fine.
  2. The bug you just reported is actually a different bug from the other ‘item_has_been_looted’ bug.
  3. I just fixed a looting bug that caused hearthling OCD which touched these functions.
2 Likes

OK, so I will updated the title of this thread to indicate that this is a “new” bug. Anything else you need me to do?

1 Like

Nope. Thanks for the help!

2 Likes

@Albert or @brad, is this the “another ‘item_has_been_looted’ error” metioned in the 2650 release note (and thus this bug is resolved)?

Yes, this should be fixed. Thanks!