The-International-Open-Source icon indicating copy to clipboard operation
The-International-Open-Source copied to clipboard

Remote haulers not withdraw / pickup energy

Open Aerics84 opened this issue 2 years ago • 2 comments

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 remote

Aerics84 avatar Sep 22 '22 11:09 Aerics84

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
    }

Aerics84 avatar Sep 22 '22 12:09 Aerics84

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.

Aerics84 avatar Oct 03 '22 09:10 Aerics84