CleverRaven / CleverRaven/Cataclysm-DDA

Magiclym: Negative Foods, able to eat forever

Open
#65,040 2 comments 0 reactions 0 assignees View on GitHub
(S2 - Confirmed) [C++] <Bug> Help Wanted Inventory / AIM / Zones Mods: Magiclysm
Dominant language
C++
Stars
13.2k
Forks
4.6k
Avg merge
2d 1h
Merged PRs (30d)
205

Description

### Describe the bug

Turns out that if you have glowing mushrooms from the Magiclym mod, and use them in an auto eat zone, you can constantly eat them until their stacks becomes negative.

DEBUG : did not found item glowing mushroom caps to remove it!

FUNCTION : i_rem
FILE : D:\a\Cataclysm-DDA\Cataclysm-DDA\src\character_inventory.cpp
LINE : 289
VERSION : 3d15dcc

Once this happens, the mushroom stack have gone into the negatives, and you can keep eating from the stack forever if you want. However, if you attempt to pick up the stack, or move the stack, you cause a stack overflow and crash the game.

### Attach save file

[Damascus-trimmed.tar.gz](https://github.com/CleverRaven/Cataclysm-DDA/files/11217236/Damascus-trimmed.tar.gz)

### Steps to reproduce

1. Press (R)ead
2. Read while auto eating, wait until you start eating glowing mushrooms (Likely a few IRL seconds)
3. Resume reading until auto eating mushrooms.
4. Voila, error!

### Expected behavior

I expected the stack to disappear upon reaching zero or negative numbers.

### Screenshots

![image](https://user-images.githubusercontent.com/21962421/231619485-577da5d7-0e4c-4a08-8e0e-4af0989e5499.png)

![image](https://user-images.githubusercontent.com/21962421/231619499-9ce2574e-8b31-45c0-b863-924509c03a70.png)

![image](https://user-images.githubusercontent.com/21962421/231619512-112b5c77-99b9-4b37-8904-7dd5f2f5494a.png)

### Versions and configuration

- OS: Windows
- OS Version: 10.0.19044.2728 (21H2)
- Game Version: 3d15dcc [64-bit]
- Graphics Version: Tiles
- Game Language: System language []
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Portal Storms Ignore NPCs [personal_portal_storms],
No Fungal Growth [no_fungal_growth],
Bionic Professions [package_bionic_professions],
Aftershock [aftershock],
Blaze Industries [blazeindustries],
Magiclysm [magiclysm],
Xedra Evolved [xedra_evolved],
Bombastic Perks [bombastic_perks],
My Sweet Cataclysm [my_sweet_cataclysm],
Mythical Martial Arts [MMA],
Crazy Cataclysm [crazy_cataclysm],
SpeedyDex [speedydex],
Stats Through Kills [stats_through_kills],
Stats Through Skills [StatsThroughSkills]
]

### Additional context

[debug.log](https://github.com/CleverRaven/Cataclysm-DDA/files/11217245/debug.log)
[crash.log](https://github.com/CleverRaven/Cataclysm-DDA/files/11217246/crash.log)

Contributor guide

Open the contributing guide

Research direction

Start in src/character_inventory.cpp at the i_rem function and reproduce the issue using the attached Damascus-trimmed.tar.gz save. Check how auto-eating glowing mushroom caps handles removal when the stack reaches zero or below. Done means the stack disappears at zero and picking up or moving it no longer causes a stack overflow or crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.