CS students looking to fix issue #23440


#1

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.


#2

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

#23440-Unloading magazines leading to move starvation


#3

Thank you for including the link :smile: . 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.


#4

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

This PR is a simple example of this process


#5

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.