Draw knife from survivor utility belt, crash

Version 3609, every time. Can draw fine from a sheath.

Can’t reproduce. Could be a save thing.

What kind of knife?

Yeah sorry, looks like a save thing

Did you transfer the save from an older version to one of the more recent experimentals?

If so, is the knife in question a tanto or survival knife?

Still happening, no save shenanigans at all. v3609

EDIT: Bingo! Non-reinforced knives do not cause crash, only reinforced, exact type seems irrelevant.

Alright, testing in build 3626, or a3a5eb2.

Survivor utility belt? Check. Steak knife? Check. Soldering iron? Check.

If you haven’t already reported this to Github, I’m gonna do some more !!SCIENCE!! on this to see what other variations yield a crash, then report it.

EDIT: Attempts to muck with this further led me to disassemble the SUB rather than debug another survivor’s belt. New bug: it ate my knife.

EDIT 2: Debugged another knife and scrap metal. Drawing knife from survivor’s belt works fine.

EDIT 3: Drawing it from a normal sheath and boots are also fine.

EDIT 4: No wait, found my knife. Didn’t eat it.

EDIT 5: Guess what? It isn’t just reinforced knives.

EDIT 6: Issue reported on github ( https://github.com/CleverRaven/Cataclysm-DDA/issues/13453 ).

Good times :slight_smile:

Plenty of science ensued. Dunno what the cause is. I have another hunch though, lemme test what happens when I reinforce or damage the belt…

EDIT: Nope. Condition of belt does not affect results.

Poked at this a little more, can’t figure out anything else. Thought it might have to do with the reinforcement status of the survivor belt used to make the utility belt but nope.

It’s a survivor belt, man. It’s seen some shit. It’d rather take out the whole world than give you back that knife.

Someone on Gith is saying they can’t reproduce this, but I’m reproducing it right now, using the exact steps they describe, in the latest experimental.

They rattled off some Cygwin or whatever stuff, so I’m assuming they aren’t using the pre-compiled versions from the main site like sane people use. :V

Confirmed: Turning off item health bars in the interface settings prevents the crash.

Oh that is weird.

Yeah this is such a weirdly specific bug. Only damaged/reinforced knives, only the utility belt, only with item health bars on, and only with certain compilers.

Go home Cataclysm, you’re drunk. >.<

You know what’s especially odd? The fact that it crashes when the utility belt containing the reinforced knife is activated. Not when the knife itself is drawn. You don’t even get the menu. That means the game isn’t even trying to draw the item health bars at the moment it crashes.

Here’s something else funny: I went looking through the jsons and it looked like the utility belt was the only item that both had tool uses and functioned as a sheath. Well, since the utility belt is also the only item causing this problem, that seemed noteworthy.

So I went into tools.json and slapped SHEATH_KNIFE into the USE_ACTION line for the toolbox. Fired up a new game, left item health bars on, made a reinforced knife, used the toolbox, and could sheath and unsheath it from the box without issue.

Then I went and replaced the entire USE_ACTION line for the toolbox with the one from the utility belt. Fired up a new game, spawned a toolbox, and sure enough had a toolbox with all the same functions as the utility belt. Except I could still sheath and unsheath reinforced knives from it, with item health bars on, without issue.

I don’t know if any of this is helpful or not but there it is.

That’s…what the fuck.

So I took the radiation biomonitor and did the same thing, replaced the USE_ACTION line with the one from the utility belt. Did the whole rigamarole. Crash. So I guess it has something to do with the item being wearable? Maybe the fact that it has an item health bar itself? Or just that they’re both in the tool_armor json? I don’t know.

Hmm, odd. Did you copy the use actions to a non-wearable item and try that?

If it works in that case, it might be because armor displays a health meter by default, whereas other items only display it when damaged or reinforced.