replaced several isdefined() && condition with is_true

This commit is contained in:
JezuzLizard 2020-08-04 20:11:21 -07:00
parent 2708e655c4
commit 3c2a324fd3
2 changed files with 19 additions and 19 deletions

View File

@ -453,7 +453,7 @@ craftable_model_attach_glow( n_elem, do_glow_now ) //checked matches cerberus ou
tomb_staff_update_prompt( player, b_set_hint_string_now, trigger ) //checked matches cerberus output
{
if ( isDefined( self.crafted ) && self.crafted )
if ( is_true( self.crafted ) )
{
return 1;
}
@ -553,7 +553,7 @@ tankcraftableupdateprompt( player, sethintstringnow, buildabletrigger ) //checke
if ( isDefined( self ) )
{
self.hint_string = "";
if ( isDefined( sethintstringnow ) && sethintstringnow && isDefined( buildabletrigger ) )
if ( is_true( sethintstringnow ) && isDefined( buildabletrigger ) )
{
buildabletrigger sethintstring( self.hint_string );
}
@ -632,7 +632,7 @@ clear_player_crystal( n_element ) //checked matches cerberus output
piece_pickup_conversation( player ) //checked changed to match cerberus output
{
wait 1;
while ( isDefined( player.isspeaking ) && player.isspeaking )
while ( is_true( player.isspeaking ) )
{
wait_network_frame();
}
@ -673,7 +673,7 @@ staff_pickup_vo() //checked matches cerberus output
{
return;
}
if ( isDefined( level.sam_staff_line_played ) && !level.sam_staff_line_played )
if ( !is_true( level.sam_staff_line_played ) )
{
level.sam_staff_line_played = 1;
wait 1;
@ -1157,7 +1157,7 @@ tomb_custom_craftable_validation( player ) //checked changed to match cerberus o
return 1;
}
str_craftable = self.stub.equipname;
if ( isDefined( level.craftables_crafted[ str_craftable ] ) && !level.craftables_crafted[ str_craftable ] )
if ( !is_true( level.craftables_crafted[ str_craftable ] ) )
{
return 1;
}
@ -1309,7 +1309,7 @@ track_staff_weapon_respawn( player ) //checked partially changed to match cerber
has_weapon = 0;
while ( isalive( player ) )
{
if ( isDefined( s_elemental_staff.charger.is_inserted ) && s_elemental_staff.charger.is_inserted || isDefined( s_upgraded_staff.charger.is_inserted ) || s_upgraded_staff.charger.is_inserted && isDefined( s_upgraded_staff.ee_in_use ) && s_upgraded_staff.ee_in_use )
if ( is_true( s_elemental_staff.charger.is_inserted ) || is_true( s_upgraded_staff.charger.is_inserted ) || is_true( s_upgraded_staff.ee_in_use ) )
{
has_weapon = 1;
break;
@ -1336,16 +1336,16 @@ track_staff_weapon_respawn( player ) //checked partially changed to match cerber
s_upgraded_staff.revive_ammo_stock = player getweaponammostock( "staff_revive_zm" );
s_upgraded_staff.revive_ammo_clip = player getweaponammoclip( "staff_revive_zm" );
}
if ( has_weapon && isDefined( player.one_inch_punch_flag_has_been_init ) && !player.one_inch_punch_flag_has_been_init && n_melee_element != 0 )
if ( has_weapon && !is_true( player.one_inch_punch_flag_has_been_init ) && n_melee_element != 0 )
{
cur_weapon = player getcurrentweapon();
if ( cur_weapon != weapon && isDefined( player.use_staff_melee ) && player.use_staff_melee )
if ( cur_weapon != weapon && is_true( player.use_staff_melee ) )
{
player update_staff_accessories( 0 );
}
else
{
if ( cur_weapon == weapon && isDefined( player.use_staff_melee ) && !player.use_staff_melee )
if ( cur_weapon == weapon && !is_true( player.use_staff_melee ) )
{
player update_staff_accessories( n_melee_element );
}

View File

@ -102,7 +102,7 @@ shovel_prompt_update( e_player ) //checked matches cerberus output
return 0;
}
self.hint_string = &"ZM_TOMB_SHPU";
if ( isDefined( e_player.dig_vars[ "has_shovel" ] ) && e_player.dig_vars[ "has_shovel" ] )
if ( is_true( e_player.dig_vars[ "has_shovel" ] ) )
{
self.hint_string = &"ZM_TOMB_SHAG";
}
@ -119,7 +119,7 @@ shovel_unitrigger_think() //checked changed to match cerberus output
{
continue;
}
if ( isDefined( e_player.dig_vars[ "has_shovel" ] ) && !e_player.dig_vars[ "has_shovel" ] )
if ( !is_true( e_player.dig_vars[ "has_shovel" ] ) )
{
e_player.dig_vars[ "has_shovel" ] = 1;
e_player playsound( "zmb_craftable_pickup" );
@ -135,7 +135,7 @@ shovel_unitrigger_think() //checked changed to match cerberus output
dig_reward_dialog( str_category ) //checked matches cerberus output
{
if ( isDefined( self.dig_vo_cooldown ) && !self.dig_vo_cooldown )
if ( !is_true( self.dig_vo_cooldown ) )
{
self do_player_general_vox( "digging", str_category );
if ( str_category != "pickup_shovel" )
@ -232,7 +232,7 @@ dig_spots_respawn( a_dig_spots ) //checked partially changed to match cerberus o
}
for ( i = 0; i < a_dig_spots.size; i++ )
{
if ( isDefined( a_dig_spots[ i ].dug ) && a_dig_spots[ i ].dug && n_respawned < n_respawned_max && level.n_dig_spots_cur <= level.n_dig_spots_max )
if ( is_true( a_dig_spots[ i ].dug ) && n_respawned < n_respawned_max && level.n_dig_spots_cur <= level.n_dig_spots_max )
{
a_dig_spots[ i ].dug = undefined;
a_dig_spots[ i ] thread dig_spot_spawn();
@ -250,7 +250,7 @@ dig_spots_respawn( a_dig_spots ) //checked partially changed to match cerberus o
{
if ( isDefined( s_dig_spot.str_zone ) && issubstr( s_dig_spot.str_zone, s_staff.zone_substr ) )
{
if ( isDefined( s_dig_spot.dug ) && !s_dig_spot.dug )
if ( !is_true( s_dig_spot.dug ) )
{
n_active_mounds++;
}
@ -294,7 +294,7 @@ dig_spot_spawn() //checked changed to match cerberus output
dig_spot_trigger_visibility( player ) //checked matches cerberus output
{
if ( isDefined( player.dig_vars[ "has_shovel" ] ) && player.dig_vars[ "has_shovel" ] )
if ( is_true( player.dig_vars[ "has_shovel" ] ) )
{
self sethintstring( &"ZM_TOMB_X2D" );
}
@ -310,7 +310,7 @@ waittill_dug( s_dig_spot ) //checked changed to match cerberus output
while ( 1 )
{
self waittill( "trigger", player );
if ( isDefined( player.dig_vars[ "has_shovel" ] ) && player.dig_vars[ "has_shovel" ] )
if ( is_true( player.dig_vars[ "has_shovel" ] ) )
{
player playsound( "evt_dig" );
s_dig_spot.dug = 1;
@ -722,7 +722,7 @@ waittill_zombie_blood_dug( s_dig_spot ) //checked changed to match cerberus outp
while ( 1 )
{
self waittill( "trigger", player );
if ( isDefined( player.dig_vars[ "has_shovel" ] ) && player.dig_vars[ "has_shovel" ] )
if ( is_true( player.dig_vars[ "has_shovel" ] ) )
{
player.t_zombie_blood_dig.origin = ( 0, 0, 0 );
player playsound( "evt_dig" );
@ -897,7 +897,7 @@ watch_devgui_dig() //dev call skipped
i = 0;
while ( i < a_dig_spots.size )
{
if ( isDefined( a_dig_spots[ i ].dug ) && a_dig_spots[ i ].dug && level.n_dig_spots_cur <= level.n_dig_spots_max )
if ( is_true( a_dig_spots[ i ].dug ) && level.n_dig_spots_cur <= level.n_dig_spots_max )
{
a_dig_spots[ i ].dug = undefined;
a_dig_spots[ i ] thread dig_spot_spawn();
@ -913,7 +913,7 @@ watch_devgui_dig() //dev call skipped
i = 0;
while ( i < a_dig_spots.size )
{
if ( isDefined( a_dig_spots[ i ].dug ) && a_dig_spots[ i ].dug )
if ( is_true( a_dig_spots[ i ].dug ) )
{
a_dig_spots[ i ].dug = undefined;
a_dig_spots[ i ] thread dig_spot_spawn();