ComfyFactory / ComfyFactorio

A compilation of factorio scenarios, featuring many different maps.
GNU General Public License v3.0
45 stars 53 forks source link

Improve charging_station.lua (closes #451) #464

Closed vadcx closed 2 months ago

vadcx commented 4 months ago

https://github.com/ComfyFactory/ComfyFactorio/issues/451

Improve algorithmic complexity as proposed. The charging button now only iterates ONCE over entire inventory and ONCE over all nearby accumulators, breaking early if enough energy was supplied.

Add support for modded accumulators. The code will check maximum energy capacity of type=accumulator entities nearby for this to work.

Add code annotations.

Improve player-facing messages.

All Submissions:

Tested Changes:

  1. [ ] Have you lint your code (lua lint) locally prior to submission?

Changes to Core Features:

Comments

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

vadcx commented 2 months ago

Silly bot, no recent activity doesn't mean the problem ceased to exist. I cannot reopen neither the issue nor the PR. I will keep pinging then.

Quadrum1 commented 2 months ago

I agree, stalebot automatically closing tickets seems odd. Sadly, it seems I don't have the permissions to reopen this ticket.