container.room incorrect



  • I've just found that when I go access my container by ID like:

    Game.getObjectById("577243d10163df3121056b94").room

    its incorrectly returning me the room E34S11 (which is the room of my second container. The object (container) with that ID is very clearly in room E32S12. Was not an issue as far as I know until I built my second container.



  • ok to add insult to injury... ANY object.room returns me E34S12.



  • ok found the bug was with this code

    if(creep.room.name = "E34S11")

    which was obviously meant to be ==, but the bug still remains as such - it definately should not let me change the name of a room. are they not const?



  • That does appear to be a bug.

    On a different note, this exact bug is why I have my IDE flag the use of assignment in conditionals as 'probably wrong', and why I trained myself to put constant first in tests ("E34S11" == creep.room.name) so that missing an = sign causes an instant error.