entity pos sets chunk now
This commit is contained in:
+1
-7
@@ -35,15 +35,9 @@ errorret_t rpgInit(void) {
|
||||
assertTrue(entIndex != 0xFF, "No available entity slots!.");
|
||||
entity_t *ent = &ENTITIES[entIndex];
|
||||
entityInit(ent, ENTITY_TYPE_PLAYER);
|
||||
entityPositionSet(ent, (worldpos_t){ 10, 2, 0 });
|
||||
entityPositionSet(ent, (worldpos_t){ 10, 2, 0 });// Also assigns the chunk.
|
||||
RPG_CAMERA.mode = RPG_CAMERA_MODE_FOLLOW_ENTITY;
|
||||
RPG_CAMERA.followEntity.followEntityId = ent->id;
|
||||
{
|
||||
chunkpos_t cp;
|
||||
worldPosToChunkPos(&ent->position, &cp);
|
||||
chunkindex_t ci = mapGetChunkIndexAt(cp);
|
||||
if(ci != -1) entitySetChunk(ent, (uint8_t)ci);
|
||||
}
|
||||
|
||||
mapSpawnEntity(3, (worldpos_t){ 8, 8, 1 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user