From bdc7e9585cbb4e2b5632a30da0238efedc2219f4 Mon Sep 17 00:00:00 2001 From: INSANEMODE Date: Fri, 30 Oct 2020 07:37:27 -0500 Subject: [PATCH 1/8] fix staff parts not glowing. replaced a for loop with a foreach to get the staff pieces for craftable_model_attach_glow to work properly. --- zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc b/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc index 01e4dfb..2b97ba9 100644 --- a/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc +++ b/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc @@ -418,7 +418,7 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output */ return; } - for ( i = 0; i < s_craftable.a_piecestubs.size; i++ ) + foreach ( s_piece in s_craftable.a_piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. { if ( s_piece.piecename == "gem" ) { From b3535325b50f91d9474c7c0abe4c1c73bbe6f133 Mon Sep 17 00:00:00 2001 From: INSANEMODE Date: Fri, 30 Oct 2020 07:45:26 -0500 Subject: [PATCH 2/8] fix 8 player staff pieces not glowing --- .../8 Player Origins Fix/zm_tomb_craftables.gsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc b/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc index e8a6de8..8f2dde3 100644 --- a/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc +++ b/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc @@ -336,7 +336,7 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output */ return; } - for ( i = 0; i < s_craftable.a_piecestubs.size; i++ ) + foreach ( s_piece in s_craftable.a_piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. { if ( s_piece.piecename == "gem" ) { From e1580f6e0bab2bf17f9d22e790e0b1be4d15c73c Mon Sep 17 00:00:00 2001 From: INSANEMODE Date: Fri, 30 Oct 2020 08:06:23 -0500 Subject: [PATCH 3/8] Update zm_tomb_craftables.gsc --- .../8 Player Origins Fix/zm_tomb_craftables.gsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc b/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc index 8f2dde3..0709210 100644 --- a/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc +++ b/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc @@ -336,7 +336,7 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output */ return; } - foreach ( s_piece in s_craftable.a_piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. + foreach ( s_piece in s_craftable.piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. { if ( s_piece.piecename == "gem" ) { From 073b82e077c403712399da779b3f8d27045a1d00 Mon Sep 17 00:00:00 2001 From: INSANEMODE Date: Fri, 30 Oct 2020 08:06:46 -0500 Subject: [PATCH 4/8] Update zm_tomb_craftables.gsc --- zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc b/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc index 2b97ba9..1b6476c 100644 --- a/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc +++ b/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc @@ -418,7 +418,7 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output */ return; } - foreach ( s_piece in s_craftable.a_piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. + foreach ( s_piece in s_craftable.piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. { if ( s_piece.piecename == "gem" ) { From e05bec482549e0bebe85d0b77cfce3a7e03541d0 Mon Sep 17 00:00:00 2001 From: INSANEMODE Date: Fri, 30 Oct 2020 08:23:47 -0500 Subject: [PATCH 5/8] Update zm_tomb_craftables.gsc --- .../8 Player Origins Fix/zm_tomb_craftables.gsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc b/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc index 0709210..8f2dde3 100644 --- a/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc +++ b/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc @@ -336,7 +336,7 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output */ return; } - foreach ( s_piece in s_craftable.piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. + foreach ( s_piece in s_craftable.a_piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. { if ( s_piece.piecename == "gem" ) { From 59cb9288ba741f3ab7cd31add5b1fedd4700c5b3 Mon Sep 17 00:00:00 2001 From: INSANEMODE Date: Fri, 30 Oct 2020 08:24:24 -0500 Subject: [PATCH 6/8] Update zm_tomb_craftables.gsc --- zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc b/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc index 1b6476c..2b97ba9 100644 --- a/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc +++ b/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc @@ -418,7 +418,7 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output */ return; } - foreach ( s_piece in s_craftable.piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. + foreach ( s_piece in s_craftable.a_piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. { if ( s_piece.piecename == "gem" ) { From 905ac1befe5434700196b0a9c6d0d1ccf06e1526 Mon Sep 17 00:00:00 2001 From: INSANEMODE Date: Fri, 30 Oct 2020 08:50:44 -0500 Subject: [PATCH 7/8] Update zm_tomb_craftables.gsc fix nested foreach infinite loop --- .../8 Player Origins Fix/zm_tomb_craftables.gsc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc b/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc index 8f2dde3..c32d316 100644 --- a/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc +++ b/Plutonium specific gsc-related fixes/8 Player Origins Fix/zm_tomb_craftables.gsc @@ -336,9 +336,11 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output */ return; } - foreach ( s_piece in s_craftable.a_piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. + piecestubs_array = s_craftable.a_piecestubs; + piecestubs_key = getFirstArrayKey( piecestubs_array ); + while ( isDefined( piecestubs_key ) ) { - if ( s_piece.piecename == "gem" ) + s_piece = piecestubs_array[ piecestubs_key ]; if ( s_piece.piecename == "gem" ) { } else @@ -354,6 +356,7 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output } s_piece.piecespawn.model thread craftable_model_attach_glow( n_elem, do_glow_now ); } + piecestubs_key = getNextArrayKey( piecestubs_array, piecestubs_key ); } } } From 61e780e5d8c712de06d36bdee5c97287e6aa9e1e Mon Sep 17 00:00:00 2001 From: INSANEMODE Date: Fri, 30 Oct 2020 08:52:36 -0500 Subject: [PATCH 8/8] Update zm_tomb_craftables.gsc fix nexted foreach infinite loop --- zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc b/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc index 2b97ba9..0bf9438 100644 --- a/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc +++ b/zm_tomb_patch/maps/mp/zm_tomb_craftables.gsc @@ -418,9 +418,11 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output */ return; } - foreach ( s_piece in s_craftable.a_piecestubs ) //replaced with a foreach to get each s_piece, which is needed for craftable_model_attach_glow to work. + piecestubs_array = s_craftable.a_piecestubs; + piecestubs_key = getFirstArrayKey( piecestubs_array ); + while ( isDefined( piecestubs_key ) ) { - if ( s_piece.piecename == "gem" ) + s_piece = piecestubs_array[ piecestubs_key ]; if ( s_piece.piecename == "gem" ) { } else @@ -432,10 +434,11 @@ craftable_add_glow_fx() //checked partially changed to match cerberus output } else { - do_glow_now = 0; + do_glow_now = 1; } s_piece.piecespawn.model thread craftable_model_attach_glow( n_elem, do_glow_now ); } + piecestubs_key = getNextArrayKey( piecestubs_array, piecestubs_key ); } } }