Search Unity

EntityManager.SetName() bug when name ends with a decimal

Discussion in 'Entity Component System' started by diegodeddo, Apr 3, 2020.

  1. diegodeddo

    diegodeddo

    Joined:
    Jan 17, 2018
    Posts:
    7
    I use Entities 0.7 and there is an unusual bug with setting entity names. It happens both setting via entity debugger or C# code. If the name ends with a stringified ulong decimal, after setting the name, the decimal part is changed to a random 32bit integer.

    Here is a name that triggers this:

    Code (CSharp):
    1. EntityManager.SetName(e, "SystemGrid - ActorId:2440230985639202934");
    If I add a trailing space to the name, hence ending it with a non decimal character, the bug disappears.

    Code (CSharp):
    1. // Workaround
    2. EntityManager.SetName(e, "SystemGrid - ActorId:2440230985639202934 ");
    I wish I could test it with Entities 0.8 but I don't plan migrating my project anytime soon.
     
    Last edited: Apr 3, 2020