IL-GSC/BO1/PC/ZM/clientscripts/_utility_code.csc
2024-02-18 17:32:07 -05:00

49 lines
2.7 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

struct_class_init()
{
assertEx( !isdefined( level.struct_class_names ), "level.struct_class_names is being initialized in the wrong place! It shouldn't be initialized yet." );
level.struct_class_names = [];
level.struct_class_names[ "target" ] = [];
level.struct_class_names[ "targetname" ] = [];
level.struct_class_names[ "script_noteworthy" ] = [];
level.struct_class_names[ "script_label" ] = [];
level.struct_class_names[ "classname" ] = [];
for( i=0; i<level.struct.size; i++ )
{
if( isdefined( level.struct[ i ].targetname ) )
{
if( !isdefined( level.struct_class_names[ "targetname" ][ level.struct[ i ].targetname ] ) )
level.struct_class_names[ "targetname" ][ level.struct[ i ].targetname ] = [];
size = level.struct_class_names[ "targetname" ][ level.struct[ i ].targetname ].size;
level.struct_class_names[ "targetname" ][ level.struct[ i ].targetname ][ size ] = level.struct[ i ];
}
if( isdefined( level.struct[ i ].target ) )
{
if( !isdefined( level.struct_class_names[ "target" ][ level.struct[ i ].target ] ) )
level.struct_class_names[ "target" ][ level.struct[ i ].target ] = [];
size = level.struct_class_names[ "target" ][ level.struct[ i ].target ].size;
level.struct_class_names[ "target" ][ level.struct[ i ].target ][ size ] = level.struct[ i ];
}
if( isdefined( level.struct[ i ].script_noteworthy ) )
{
if( !isdefined( level.struct_class_names[ "script_noteworthy" ][ level.struct[ i ].script_noteworthy ] ) )
level.struct_class_names[ "script_noteworthy" ][ level.struct[ i ].script_noteworthy ] = [];
size = level.struct_class_names[ "script_noteworthy" ][ level.struct[ i ].script_noteworthy ].size;
level.struct_class_names[ "script_noteworthy" ][ level.struct[ i ].script_noteworthy ][ size ] = level.struct[ i ];
}
if( isdefined(level.struct[i].script_label ) )
{
if( !isdefined( level.struct_class_names[ "script_label" ][ level.struct[ i ].script_label ] ) )
level.struct_class_names[ "script_label" ][ level.struct[ i ].script_label] = [];
size = level.struct_class_names[ "script_label" ][ level.struct[ i ].script_label].size;
level.struct_class_names[ "script_label" ][ level.struct[ i ].script_label ][ size ] = level.struct[ i ];
}
if( isdefined(level.struct[i].classname ) )
{
if( !isdefined( level.struct_class_names[ "classname" ][ level.struct[ i ].classname ] ) )
level.struct_class_names[ "classname" ][ level.struct[ i ].classname] = [];
size = level.struct_class_names[ "classname" ][ level.struct[ i ].classname].size;
level.struct_class_names[ "classname" ][ level.struct[ i ].classname ][ size ] = level.struct[ i ];
}
}
}