Skip to content

TypeError: room.drops[resourceType] is not iterable #205

Description

@xyzzy529

Issue summary

Installed fresh 0.5.2.1 and received below error

Description of issue:

The room was stuck not harvesting or upgrading.
https://screeps.com/a/#!/room/shard0/W12S22

I re-copied the 0.5.2.1 release and it gave error.

Steps to reproduce:

AFAIK, just copy/paste the 0.5.2.1 version into main and commit it in screeps/scripts. Then error appears.
The room was previously built out.

Error message:

[11:21:45 AM][shard0]drops: 0 [ruin (link) #626426ae1fdb0a4b034f6fae]
[11:21:45 AM][shard0]TypeError: room.drops[resourceType] is not iterable
    at Overseer.registerLogisticsRequests (main:23745:44)
    at Overseer.init (main:23952:18)
    at _Overmind.init (main:24061:6199)
    at main (main:24313:14)
    at Object.wrap (main:969:16)
    at Object.loop (main:24322:21)
    at __mainLoop:1:52
    at __mainLoop:2:3
    at Object.exports.evalCode (<runtime>:15845:76)
    registerLogisticsRequests(colony) {
        // Register logistics requests for all dropped resources and tombstones
        for (let room of colony.rooms) {
            // Pick up all nontrivial dropped resources
            for (let resourceType in room.drops) {
                console.log("drops:", resourceType, room.drops[resourceType]);  // <--- Added for Debug
                for (let drop of room.drops[resourceType]) {                                 // <--- throws error
                    if (drop.amount > LogisticsNetwork.settings.droppedEnergyThreshold
                        || drop.resourceType != RESOURCE_ENERGY) {
                        colony.logisticsNetwork.requestOutput(drop);
                    }
                }
            }
        }

Suggested fix (optional):

unknown

Other information:

‣ Version: Overmind v0.5.2
‣ Checksum: 0x2bf8f766f8e
‣ Assimilated: No (clearance code: null) [WIP]
‣ Operating mode: automatic

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions