ref: e1a86db17238fd177e7b413825fc17991328532f
parent: 32382f127cbd4c0c267012d1381083af86b4f353
author: gek169 <gek169>
date: Sun May 9 16:48:28 EDT 2021
Automatic commit.
--- a/include-demo/chade.h
+++ b/include-demo/chade.h
@@ -88,17 +88,19 @@
static inline void stepChadWorld(ChadWorld* world, long iter){
stepPhysWorld(&world->world, iter);
}
-static inline void ChadWorld_AddEntity(ChadWorld* world, ChadEntity* ent){
+static inline long ChadWorld_AddEntity(ChadWorld* world, ChadEntity* ent){
/*safety check.
for(long i = 0; i < world->max_ents; i++)
- if(world->ents[i] == ent) return;
+ if(world->ents[i] == ent) return i;
*/
for(long i = 0; i < world->max_ents; i++){
if(world->ents[i] == NULL){
- world->ents[i] = ent; return;
+ world->ents[i] = ent;
world->world.bodies[i] = &ent->body;
+ return i;
}
}
+ return -1;
}