Bug in Switch composite

Forums 💬 NodeCanvas ⚙️ Support Bug in Switch composite

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16085
    wizardscode
    Participant

      I found a bug in the Switch composite. I always define the int values of enums so that I can insert different values later without having to re-index everything. e.g.

      enum state {state1 = 100, state2 = 200, state3 300 }

      However, the Switch composite assumes that the int values are 0, 1, 2. Thus current >= outConnections.Count in line 71 is true and an error is returned rendering the Switch inoperable.

      #16086
      Gavalakis
      Keymaster

        Hello,

        You are right. I have just modified Switch to work correctly in this case. Please find the modified node attached and let me know if it works for you. Thanks! 🙂

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.