clear runs when respawning FIX_RESPAWN_EXPLOIT
authorhgn <hgodden00@gmail.com>
Thu, 5 Oct 2023 11:11:46 +0000 (12:11 +0100)
committerhgn <hgodden00@gmail.com>
Thu, 5 Oct 2023 11:11:46 +0000 (12:11 +0100)
player.c

index c79132f7e53fa6c2ed5db5809ee180108326999b..399de519620f7e2a428f92e01eeb536c9979dfdd 100644 (file)
--- a/player.c
+++ b/player.c
@@ -288,6 +288,13 @@ PLAYER_API void player__spawn( player_instance *player, ent_spawn *rp ){
    world_static.challenge_timer = 0.0f;
    world_entity_unfocus();
 
+   for( u32 i=0; i<vg_list_size(world_static.instances); i++ ){
+      world_instance *instance = &world_static.instances[i];
+      if( instance->status == k_world_status_loaded ){
+         world_routes_clear( instance );
+      }
+   }
+
    if( _player_reset[ player->subsystem ] )
       _player_reset[ player->subsystem ]( player, rp );
 }