X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_entity.c;h=440229102ecc8d548635c70dc1d100b5af76b186;hb=03a46e5a504cfb2f8bef7254a66753f04540005f;hp=d8f4259dacd67179503656e569c6d415d68a1edb;hpb=403bb2442600b86f50d842ec059eb3f54c8ca5ec;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_entity.c b/world_entity.c index d8f4259..4402291 100644 --- a/world_entity.c +++ b/world_entity.c @@ -277,6 +277,19 @@ ent_spawn *world_find_spawn_by_name( world_instance *world, const char *name ) return rp; } +static void world_default_spawn_pos( world_instance *world, v3f pos ) +{ + ent_spawn *rp = world_find_spawn_by_name( world, "start" ); + if( !rp ) rp = world_find_closest_spawn( world, (v3f){0,0,0} ); + if( rp ) + v3_copy( rp->transform.co, pos ); + else + { + vg_error( "There are no valid spawns in the world\n" ); + v3_zero( pos ); + } +} + static void ent_volume_call( world_instance *world, ent_call *call ){ u32 index = mdl_entity_id_id( call->id ); ent_volume *volume = mdl_arritm( &world->ent_volume, index );