RecentHotbar


Scrolls the quickbar/hotbar with things you recently used. Now on 2.1, with extra width quickbar support and spidertron remote handling.

Utilities
a month ago
0.18 - 2.1
543

b <FIXED?> Crash when hotbar is full

a month ago

Here is the end of my log file:

  24.459 Loading level.dat: 56478491 bytes.
  24.460 Info Scenario.cpp:152: Map version 2.1.24-1
  26.523 Loading blueprint storage: Local timestamp 1793220065, Cloud timestamp 1793219949
  27.626 Loading script.dat: 8765263 bytes.
  27.639 Checksum for script __level__/control.lua: 166680124
  27.642 Checksum for script __circuit_visualizer_fork__/control.lua: 3312576088
  27.646 Checksum for script __expandtooltip__/control.lua: 1108213949
  27.649 Checksum for script __factory-efficiency-tracker__/control.lua: 508706436
  27.654 Checksum for script __inserter-flip-indicator__/control.lua: 1242586393
  27.661 Checksum for script __legacy-rail-planner__/control.lua: 354942851
  27.663 Checksum for script __RecentHotbar__/control.lua: 3703578295
  27.676 Checksum for script __RateCalculator__/control.lua: 1555218232
  57.938 Info AppManager.cpp:335: Saving to _autosave5 (blocking).
  59.610 Info AppManagerStates.cpp:2131: Saving finished
 107.334 Error MainLoop.cpp:1505: Exception at tick 29252801: The mod RecentHotbar (0.4.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event RecentHotbar::on_player_cursor_stack_changed (ID 37)
__RecentHotbar__/control.lua:270: attempt to compare nil with number
stack traceback:
    __RecentHotbar__/control.lua:270: in function <__RecentHotbar__/control.lua:1>
 128.881 Info AppManager.cpp:364: Deleting active scenario.

The crash happened when I pipetted a new item while my hotbar (20 items wide) had no empty slots. Earlier I also pipetted an item that was already on the "recent" hotbar and it appeared there again, in a new slot that I had just cleared. I have in-place replacement turned on btw.

a month ago

I've just actioned a "fix"? I wasn't able to recreate your error but I have implemented a check and avoidance to hopefully preclude the error from reoccurring. I have also changed the underlying logic of the code that searches for an existing item in the hotbar, it now prioritises existing items over empty slots, to better match what you said in the latter half of your post.
As always, if you encounter any more bugs don't hesitate to post here, I'll be here to action fixes where required.

a month ago

I was in editor mode when it happend, maybe that matters? It doesn't crash anymore now, but I think you left a print/debug statement on because "not ghost" is often printed to the console.

a month ago

Sorry about that, accidentally left in my print statements I used for debugging, they should be gone now, appreciate the report.

New response