Bug - Fixed Multi-eating s'mores doesn't update smoresEaten correctly

Xande1

Member
If you eat multiple s'mores at once via CLI eat n s'more or ASH eat(n, $item[s'more]), the smoresEaten preference only gets incremented by one, regardless of how many s'mores you ate. This isn't a problem for eating via the item manager, which only allows you to queue s'mores one at a time (you can have multiples queued, but only as separate items).

parseConsumption() is where the preference update happens, and it doesn't have access to the number of items being eaten (at least, not any way that I can see). So the included patch adds s'mores to singleConsume(), so they'll get eaten in separate requests, and the preference will correctly be incremented by 1 for each s'more. Lightly tested, but tested, and the change causes smoresEaten to update correctly.

PS For future reference, for small changes like this, do devs prefer attached patch files, the patch file in a /code block, or something else?
 

Attachments

  • mafia-smores.patch
    482 bytes · Views: 2

fronobulax

Developer
Staff member
My process is to save the patch file locally and then apply it via svn. I prefer an attached file for that since I don't know how to copy text and apply a patch directly from the copy buffer. I need an intermediate file anyway. It is also cleaner in case something doesn't work.

I will look at this but today is looking busy so if someone else beats me that's fine.
 

MCroft

Developer
Staff member
Up to a certain size, I’m indifferent.
IntelliJ has a “apply patch from clipboard” feature.
For complex things, I tend to use patch files, even for my own changes. I will apply them to my “KM-clean” sandbox and make sure they compile, test, etc, before committing.
 

fronobulax

Developer
Staff member
IntelliJ has a “apply patch from clipboard” feature.
Ah. I use svn from a Windows context menu and compile from a batch file. IntelliJ does not enter the picture unless it is a large patch, the diff svn offers me before commit raises some questions, or I want to run the lint equivalent.
 
Top