Slick Forums

Discuss the Slick 2D Library
It is currently Fri Feb 28, 2020 3:02 am

All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Mon Feb 18, 2013 8:33 pm 
Offline

Joined: Sun Nov 04, 2012 7:01 pm
Posts: 7
This error only occurs because you are trying to access a component that has not been added. Because it has not been added, the bag wasn't resized and there is no check whether or not the bag holding the components is big enough.

If you take a look at https://code.google.com/p/artemis-frame ... apper.java it does exactly this check in the getSafe-method. A similar method or check could be added to Entity or the ComponentManager to prevent this.

The error should also be reproducible if you only add your component to the first entity and then create a bunch of new entities without any component. The getComponent-method will fail at index 64 too. But I'm not sure whether or not to call this a bug...


Top
 Profile  
 
PostPosted: Tue Mar 12, 2013 2:33 am 
Offline

Joined: Fri Jul 13, 2012 9:59 pm
Posts: 25
I didn't know about that GetSafe method, and prolly appel knows about this, so I don't think it's a bug. Maybe put methods to access this GetSafe would solve this issue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group