The-International-Open-Source
The-International-Open-Source copied to clipboard
Remote haulers not withdraw / pickup energy
Describe the bug The container at a remote room is full and a few thousand energy lying on the floor. All remote haulers staying near to the source and doing nothing.
Expected behaviour Picking up first the energy lying on the floor and after from the container.
How can we reproduce this? Not sure, but can can see it at the timestamp and a little bit before, too.
Potential fix I don't know :)
Applicable media
https://screeps.com/a/#!/history/shard2/E53N41?t=43678088
In my eyes the problem is the reservations. The creeps have an id in their memory which not exits anymore and they hang.
My fix:
Creep.prototype.fulfillReservation = function () {
....
const target = findObjectWithID(reservation.targetID)
if (!target) {
this.deleteReservation(0)
return true
}
The bug is still their.
It have to be something with the function relayCoord()
.
My quick solution till someone find the real problem: if (creepAtPos.memory.SI !== this.memory.SI) return false
If the creeps passing each other from different sources and give the energy and job to the other one it can happen, that the withdraw job is for sourceContainer0 and the si is 1 in the memory.