Skip to content

[Bug]: enums from the api can't be used as table keys #1162

Description

@The4codeblocks

Is there an existing issue for this?

  • I have searched the existing issues

Summary

an enum value from an API function can't key a table made with the same enum from Enums

Where did you encounter the bug?

Server

What platform(s) does this happen on?

All platforms

Polytoria version / commit

2.0.22

Godot and .NET versions

No response

System details

No response

Build configuration

Official downloaded build

Steps to reproduce

script:

local e = Enums.CharacterModelState.Idle
local t = {[e] = 1}
local lp = Players.LocalPlayer
lp.Character.CurrentState = e
print(e, lp.Character.CurrentState, t[lp.Character.CurrentState])

Expected behavior

table keys not caring about the enum source

Actual behavior

tables being indexed differently by api returns and Enums values, like they're different objects

Logs / console output


Screenshots, video, sample project, or world file

Image

Reproducibility

Always

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugSomething is not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions