# CS students looking to fix issue #23440

**URL:** https://discourse.cataclysmdda.org/t/cs-students-looking-to-fix-issue-23440/17737
**Category:** The Toolbox
**Created:** [December 4, 2018, 5:24pm UTC](https://discourse.cataclysmdda.org/t/cs-students-looking-to-fix-issue-23440/17737 "2018-12-04T17:24:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![audiencia-cereal](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@audiencia-cereal](https://discourse.cataclysmdda.org/u/audiencia-cereal)
#### Post date: [December 4, 2018, 5:24pm UTC](https://discourse.cataclysmdda.org/t/cs-students-looking-to-fix-issue-23440/17737/1 "2018-12-04T17:24:06Z")

</div>

We’re a group of CS students looking to make a contribution to an open source project. We’ve come across issue #23440, labeled “Good First Issue”, on the GitHub repo and we’re going to try to tackle it. We were hoping to use this forum to get guidance and feedback as we try to make a contribution.

---

<div class="post-metadata">

### Author: ![Theundyingcode](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/theundyingcode/32/500_2.png) [@Theundyingcode](https://discourse.cataclysmdda.org/u/Theundyingcode)
#### Post date: [December 4, 2018, 5:29pm UTC](https://discourse.cataclysmdda.org/t/cs-students-looking-to-fix-issue-23440/17737/2 "2018-12-04T17:29:06Z")

</div>

My first suggestion is to provide a link to the issue rather than just giving the name:

[#23440-Unloading magazines leading to move starvation](https://github.com/CleverRaven/Cataclysm-DDA/issues/23440)

---

<div class="post-metadata">

### Author: ![f0cus10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/f0cus10/32/4060_2.png) [@f0cus10](https://discourse.cataclysmdda.org/u/f0cus10)
#### Post date: [December 4, 2018, 5:52pm UTC](https://discourse.cataclysmdda.org/t/cs-students-looking-to-fix-issue-23440/17737/3 "2018-12-04T17:52:45Z")

</div>

Thank you for including the link 😄 . I am one of the students and I apologise on his behalf, we are new to this community and the open source world in general, so we greatly appreciate your support.

---

<div class="post-metadata">

### Author: ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)
#### Post date: [December 4, 2018, 5:57pm UTC](https://discourse.cataclysmdda.org/t/cs-students-looking-to-fix-issue-23440/17737/4 "2018-12-04T17:57:13Z")

</div>

As outlined in the issue, the action needs to be adjusted to be interruptable. Dda supports this kind of thing via a framework we call “activity handlers”.

Basically at the callsite where the action currently happens, create an activity object and enqueue it, then exit to the main game loop.

Then hoist the meat of the action into some functions in [https://github.com/CleverRaven/Cataclysm-DDA/blob/3765602255a903c7668f404c86280ec4608d2e6d/src/activity\_handlers.cpp](https://github.com/CleverRaven/Cataclysm-DDA/blob/3765602255a903c7668f404c86280ec4608d2e6d/src/activity_handlers.cpp)

This PR is a simple example of this process

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/24384>

---

<div class="post-metadata">

### Author: ![f0cus10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/f0cus10/32/4060_2.png) [@f0cus10](https://discourse.cataclysmdda.org/u/f0cus10)
#### Post date: [December 4, 2018, 6:21pm UTC](https://discourse.cataclysmdda.org/t/cs-students-looking-to-fix-issue-23440/17737/5 "2018-12-04T18:21:39Z")

</div>

Thanks so much, Kevin. We have seen you around the repo quite a bit and we appreciate your guidance on it. We will keep you updated as we dig into the code.

---

<div class="post-metadata">

### Author: ![yizongk](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yizongk](https://discourse.cataclysmdda.org/u/yizongk)
#### Post date: [December 15, 2018, 2:59am UTC](https://discourse.cataclysmdda.org/t/cs-students-looking-to-fix-issue-23440/17737/6 "2018-12-15T02:59:19Z")

</div>

The activity\_handlers have parameter of (player\_activity \*act, player \*p). The unloading function takes in a ‘item’ class, not a ‘player’ class. That means I will need to somehow find the item in ‘player’. I currently cannot find the ‘inventory’ in player class. Are you able to give us some insight on the order of things that happens, or its framework.
