Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Out of bounds error #240

Open
zendorx opened this issue Oct 15, 2024 · 3 comments
Open

[Bug] Out of bounds error #240

zendorx opened this issue Oct 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@zendorx
Copy link

zendorx commented Oct 15, 2024

var cmd = new CommandBuffer();
var e = cmd.Create(new ComponentType[..]);
var er = e.Reference(); // Cause out of bounds error

@genaray genaray added the bug Something isn't working label Oct 24, 2024
@genaray
Copy link
Owner

genaray commented Oct 24, 2024

Well this kinda makes sense. It creates a buffer entity which does not exist yet (in the world, since its buffered)... and e.Reference() creates a reference to it, which is non existing and thus throws an exception.

@zendorx
Copy link
Author

zendorx commented Oct 26, 2024

Right, but I think it good to have some asserts or debug mode errors that help to find out what problem is. Because it is not obvious that method that exists in class cannot be used in that situation.

@zendorx
Copy link
Author

zendorx commented Nov 9, 2024

I also wanted to ask how to do it right in that case. I create entity with command buffer and I need to save reference for it. It there some right approach to do it? Like a pattern probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants