From 39cc0f9a1567ec82a499962e5caa89359a8375b2 Mon Sep 17 00:00:00 2001 From: ineedbots Date: Mon, 28 Jun 2021 19:55:38 -0600 Subject: [PATCH] Fix weirdness --- mods/bots/maps/mp/bots/_bot.gsc | 14 ++++++++++++++ mods/bots/maps/mp/bots/_bot_utility.gsc | 3 +++ 2 files changed, 17 insertions(+) diff --git a/mods/bots/maps/mp/bots/_bot.gsc b/mods/bots/maps/mp/bots/_bot.gsc index b3fc2ef..8143211 100644 --- a/mods/bots/maps/mp/bots/_bot.gsc +++ b/mods/bots/maps/mp/bots/_bot.gsc @@ -272,9 +272,21 @@ onPlayerConnect() player thread watchWeapons(); player thread watchVelocity(); player thread watchVars(); + player thread doPlayerModelFix(); } } +/* + Fixes a weird iw3 bug when for a frame the player doesn't have any bones when they first spawn in. +*/ +doPlayerModelFix() +{ + self endon( "disconnect" ); + self waittill( "spawned_player" ); + wait 0.05; + self.bot_model_fix = true; +} + /* CoD2 */ @@ -442,6 +454,8 @@ connected() spawnBot() { + self endon( "disconnect" ); + wait 5; self notify( "menuresponse", game["menu_team"], "autoassign" ); diff --git a/mods/bots/maps/mp/bots/_bot_utility.gsc b/mods/bots/maps/mp/bots/_bot_utility.gsc index e92daa5..c7e60e9 100644 --- a/mods/bots/maps/mp/bots/_bot_utility.gsc +++ b/mods/bots/maps/mp/bots/_bot_utility.gsc @@ -466,6 +466,9 @@ getTagOrigin( where ) if ( !isAlive( self ) ) return ( 0, 0, 0 ); + if ( !isDefined( self.bot_model_fix ) ) + return self.origin; + if ( !isDefined( self.tags ) ) { self.tags = [];