more script fixes

This commit is contained in:
ineedbots 2021-11-11 23:13:37 -06:00
parent 18c67cb334
commit 97236e2e5f
3 changed files with 53 additions and 5 deletions

View File

@ -2689,6 +2689,42 @@ detach_hip_weapon()
} }
FixHideTagList( hideTagList, stowWeapon )
{
answer = [];
for ( i = 0; i < hideTagList.size; i++ )
{
tag = hideTagList[ i ];
if ( stowWeapon == "weapon_ak74u" )
{
if ( tag == "tag_reflex_sight" || tag == "tag_acog" || tag == "tag_ak47_mount" )
continue;
}
else if ( stowWeapon == "weapon_ak47_classic" )
{
if ( tag == "tag_reflex_sight" || tag == "tag_acog" || tag == "tag_ak47_mount" )
continue;
}
else if ( stowWeapon == "worldmodel_bo2_peacekeeper" )
{
if ( tag == "tag_holo" || tag == "tag_reflex" || tag == "tag_silencer" )
continue;
}
else if ( stowWeapon == "weapon_beretta" )
{
if ( tag == "tag_knife" )
continue;
}
answer[ answer.size ] = tag;
}
return answer;
}
stow_on_back() stow_on_back()
{ {
prof_begin( "stow_on_back" ); prof_begin( "stow_on_back" );
@ -2779,6 +2815,8 @@ stow_on_back()
return; return;
} }
hideTagList = FixHideTagList( hideTagList, self.tag_stowed_back );
for ( i = 0; i < hideTagList.size; i++ ) for ( i = 0; i < hideTagList.size; i++ )
self HidePart( hideTagList[ i ], self.tag_stowed_back ); self HidePart( hideTagList[ i ], self.tag_stowed_back );
@ -2816,6 +2854,8 @@ stow_on_hip()
if ( !isDefined( hideTagList ) ) if ( !isDefined( hideTagList ) )
return; return;
hideTagList = FixHideTagList( hideTagList, self.tag_stowed_hip );
for ( i = 0; i < hideTagList.size; i++ ) for ( i = 0; i < hideTagList.size; i++ )
self HidePart( hideTagList[ i ], self.tag_stowed_hip ); self HidePart( hideTagList[ i ], self.tag_stowed_hip );
} }

View File

@ -231,8 +231,10 @@ waitForChangeTeam()
for ( ;; ) for ( ;; )
{ {
self waittill ( "joined_team" ); self waittill ( "joined_team" );
clearKillstreaks(); self clearKillstreaks();
self clearUsingRemote();
if ( self isUsingRemote() )
self clearUsingRemote();
} }
} }
@ -861,7 +863,9 @@ clearRideIntro( delay )
destroyOnEvents(elem) destroyOnEvents(elem)
{ {
self waittill_either("disconnect", "start_killstreak_hud"); self waittill_either("disconnect", "start_killstreak_hud");
elem destroy();
if ( isDefined( elem ) )
elem destroy();
} }
initKillstreakHud(inity) initKillstreakHud(inity)

View File

@ -36,8 +36,12 @@ destoryHPdraw()
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self waittill( "death" ); self waittill( "death" );
self.drawHP destroy();
self.drawSpeed destroy(); if ( isDefined( self.drawHP ) )
self.drawHP destroy();
if ( isDefined( self.drawSpeed ) )
self.drawSpeed destroy();
} }
initHPdraw() initHPdraw()