build system revision
[carveJwlIkooP6JGAAIwe30JlM.git] / world_entity.c
index 831e7eb674c4c728d0be1b01c17ccf0635370d25..957891d4f21e059acfdfbcd98e5a3722ae9ec630 100644 (file)
@@ -320,7 +320,7 @@ static void ent_volume_call( world_instance *world, ent_call *call ){
       call->id = volume->target;
 
       if( volume->flags & k_ent_volume_flag_particles ){
-         assert(0);
+         vg_warn( "Invalid condition; calling leave on particle volume.\n" );
       }
       else{
          call->function = volume->trigger.event_leave;
@@ -661,7 +661,10 @@ static void world_entity_start( world_instance *world, vg_msg *sav ){
       ent_challenge *challenge = mdl_arritm( &world->ent_challenge, i );
       const char *alias = mdl_pstr( &world->meta, challenge->pstr_alias );
 
-      if( vg_msg_getkvu32( sav, alias, 0 ) ){
+      u32 result;
+      vg_msg_getkvintg( sav, alias, k_vg_msg_u32, &result );
+
+      if( result ){
          ent_call call;
          call.data = NULL;
          call.function = 0;
@@ -678,9 +681,13 @@ static void world_entity_start( world_instance *world, vg_msg *sav ){
          vg_msg route_info = routes_block;
          if( vg_msg_seekframe( &route_info, 
                                mdl_pstr(&world->meta,route->pstr_name) ) ){
-            route->flags |= vg_msg_getkvu32( &route_info, "flags", 0 );
-            route->best_laptime =
-               vg_msg_getkvf64( &route_info, "best_laptime", 0.0 );
+
+            u32 flags;
+            vg_msg_getkvintg( &route_info, "flags", k_vg_msg_u32, &flags );
+            route->flags |= flags;
+
+            vg_msg_getkvintg( &route_info, "best_laptime", k_vg_msg_f64,
+                              &route->best_laptime );
 
             f32 sections[ route->checkpoints_count ];
             vg_msg_cmd cmd;
@@ -731,7 +738,7 @@ static void world_entity_serialize( world_instance *world, vg_msg *sav ){
       ent_challenge *challenge = mdl_arritm(&world->ent_challenge,i);
 
       const char *alias = mdl_pstr(&world->meta,challenge->pstr_alias);
-      vg_msg_wkvu32( sav, alias, challenge->status );
+      vg_msg_wkvnum( sav, alias, k_vg_msg_u32, 1, &challenge->status );
    }
    
    if( mdl_arrcount(&world->ent_route) ){
@@ -741,8 +748,9 @@ static void world_entity_serialize( world_instance *world, vg_msg *sav ){
          
          vg_msg_frame( sav, mdl_pstr( &world->meta, route->pstr_name ) );
          {
-            vg_msg_wkvu32( sav, "flags", route->flags );
-            vg_msg_wkvf64( sav, "best_laptime", route->best_laptime );
+            vg_msg_wkvnum( sav, "flags", k_vg_msg_u32, 1, &route->flags );
+            vg_msg_wkvnum( sav, "best_laptime", 
+                           k_vg_msg_f64, 1, &route->best_laptime );
 
             f32 sections[ route->checkpoints_count ];