Closed saibantes closed 1 month ago
The first variant sounds best to me. :) If you found a solution, you could open a PR for that :)
The first variant seems to be the most complicated. Keep in mind that items that will be picked up are being locked, so that no other gnome will try to pick them up as well. Ending up not picking up the item but keeping it locked would make the fix worse than the bug.
The third options seems to be the easiest. I am currently testing
proc sparetime_eat_end {} {
global sparetime_disappointment sparetime_eat_item
if {[lsearch [inv_list this] $sparetime_eat_item]!=-1} {
log "mealtime ends, so I will drop my leftovers ([get_objname $sparetime_eat_item])"
beamto_world $sparetime_eat_item
}
set sparetime_eat_item 0
sparetime_check_in 0
set sparetime_disappointment 0.0
// log "sparetime_eat_end"
}
in z_spare_procs.tcl.
When a gnome's sparetime ends while they are on their way to eat, they will still continue to pick up the food item, but not eat it. This is bad because it blocks one inventory slot during work.
The reason is that in z_spare_procs.tcl, proc sparetime_eat_start, at the very end sparetime_eat_item is set but not used right away. Instead the gnome will eat it at the next call to sparetime_eat_loop - which will not occur if the sparetime ended.
This can be fixed in several ways:
I might think of a solution later.