Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upInfinite Armor Duplication Bug #23073
Comments
ZenZen2
added
<Bug>
NPC / Factions
(S1 - Need confirmation)
labels
Feb 28, 2018
This comment has been minimized.
This comment has been minimized.
|
There is also typo in error message - should be "Tried to remove an item in inventory". |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
It was not your typo. Typo is in that message. Article "an" should be used. |
This comment has been minimized.
This comment has been minimized.
|
Ah, wasn't quite sure what you meant at first. |
This comment has been minimized.
This comment has been minimized.
CoroNaut
commented
Mar 1, 2018
|
All because correct grammar is more important the actual bug :D |
This comment has been minimized.
This comment has been minimized.
|
Spellcheck ftw! |
Night-Pryanik
added
(S2 - Confirmed)
<Exploit>
and removed
(S1 - Need confirmation)
labels
Mar 5, 2018
This comment has been minimized.
This comment has been minimized.
|
I think the problem is linked to the Cataclysm-DDA/src/armor_layers.cpp Lines 516 to 530 in 0ef460d This code is called from within a Character object representing an NPC, but items are taken from Changing the code to use item_location loc = game_menus::inv::wear( *this );
// only equip if something valid selected!
if( loc ) {
// wear the item
if( wear( this->i_at( loc.obtain( *this ) ) ) ) {seems to solve the problem, but then UI messages become inconsistent and keep referencing "you" instead of the NPCs name. |

TrainStation123 commentedFeb 28, 2018
Game version:
0.C g74036ec
Operating system:
Windows 7 x64
Tiles or curses:
Tiles
Mods active:
(Full List, top to bottom)
-Dark Days Ahead
-Filthy Clothing
-Disable NPC Needs
-Simplified Nutrition
-Bionics Systems Mod
-Makeshift Items Mod
-Icecoon's Arsenal
-More Survival Tools
-Mutant NPCs
-NPC traits
-More Buildings
-Extended Realistic Guns
-Classes and Scenarios Mod
-StatsThroughSkills
Expected behavior
Sort Armor on a friendly NPC to set up clothing/armor.
Actual behavior
Using the Equip armor from inventory (e), causes an error message (no crash). Continuing from error, the NPC is wearing the item, however it is not removed from the player inventory. This is easily exploited to make infinite armor/rags/weapons/etc.
DEBUG : Tried to remove a item in inventory (name: Example)
Function : item inventory::remove_item(const item*)
FILE : src/inventory.ccp
LINE : 525
Steps to reproduce the behavior