[1.0.54] Stealing by right-click-taking ANY backpack to main inventory doesn't trigger "commiting crime"

Post Reply
Blake
Posts: 14
Joined: Thu Jun 10, 2021 7:25 am

Fri Jun 11, 2021 10:30 am

Stealing by "fast-taking" (Right mouse click) ANY backpack from an unconcious enemy while being close to any number of his allies doesn't trigger the "commiting crime" tag in the event that the backpack to steal has at least 1 item inside (even from the enemy) and you already have a filled backpack in the "backpack slot" in your inventory. This results in an exploit that allows the player to steal any backpack from any downed character as long as he fast-right clicks on it to take it to the main inventory.

How to reproduce:

1-Take a backpack to your main backpack inventory slot and completely fill it with whatever you want (skins, for example), but it NEEDS to be filled.

2-Approach a fallen enemy with any character you are playing with, with or without thievery skills. I recommend approaching a plain old Caravan Trade Guard with a small backpack.

3- Having your filled backpack in the backpack slot (you can leave it open to see it better) you now need to put an extra item into the enemy's backpack . WARNING : It can be an item from that fallen enemy himself or even one of yours (but leave your backpack filled and in the backpack slot as is, do not take anything from there , just take it from anywhere else).


4. Once the enemy has an item inside his backpack, Right-click on his backpack to fast-move it to your main inventory.

5-As you can see, the "commiting crime" tag didn't trigger. That tag won't trigger as long as you right-click in an enemy backpack with something inside. Should happen with Garru backpacks too .

HOW NOT TO REPRODUCE:

1- This won't work: If the enemy has an empty backpack and you have none, right clicking in it will transfer it to your backpack slot. This will trigger the "commiting crime" tag as intended.

2-This won't work (for the bug) either: If you have a completely filled backpack in the backpack slot but the enemy has an empty backpack. You try to right-click it . The commiting crime tag will also trigger as intended when it moves to your main inventory.

3-You did everything right, backpack in the backpack slot, check! ; backpack filled with skins, check!, and an enemy with 1 item in his backpack, (check!). But instead of right-clicking you use click and drag (left click, drag and put the stolen backpack in your main inventory) resulting in the "commiting crime" tag ALSO triggering.


The only way for this bug to happen is when a backpack with something inside from the enemy is stolen WITH RIGHT CLICK while the player is having a filled backpack (both contents and backpack slot are in use) and enough space in the main inventory (for said stolen backpack).


SOLUTION:

Right click is a nice and fast way of moving items, but it needs to account for "[ a stolen backpack that has something inside and gets put into the main inventory (not in the backpack slot)]".

Expected result: Stealing that backpack (with something inside) with right click (enemy to player MAIN inventory) should trigger "commiting crime" 3s + as intended, to avoid exploits of free non-punishable offenses.

I can't fix this bug in the editor, so it's an input- mechanics problem that should not be difficult to fix, it's just that I don't currently have the tools for it.

So go to the code of Kenshi, look for relations to declared thingies like these :

mouse_command variable and mouse_select reference (can be seen in the "Controls" file in the Kenshi installation folder).

mouse_select reference should use by default "Mouse 1", and it has de ability to trigger the commiting crime tag. so it might hint at a way to fix "mouse command" input (Mouse 2 by default and our culprit) to also call for it under the action responsible for moving items to the main inventory (and not the backpack).

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests