From 87f18c38bd2660f1455725bcb5e7db7f9716c3d4 Mon Sep 17 00:00:00 2001 From: DudeMcDude Date: Thu, 29 Sep 2022 11:21:05 +0300 Subject: [PATCH 1/4] Fixed constant-size party reference error in hedrack_allies script (Co8) --- tpdatasrc/co8fixes/scr/py00040hedrack_allies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpdatasrc/co8fixes/scr/py00040hedrack_allies.py b/tpdatasrc/co8fixes/scr/py00040hedrack_allies.py index 49d162c5b..98dbeaecf 100644 --- a/tpdatasrc/co8fixes/scr/py00040hedrack_allies.py +++ b/tpdatasrc/co8fixes/scr/py00040hedrack_allies.py @@ -77,7 +77,7 @@ def san_heartbeat( attachee, triggerer ): game.global_vars[747] = 0 elif (attachee.name == 8076): # hedrack ally mage 2 - if (attachee.distance_to(game.party[0]) <= 100 or attachee.distance_to(game.party[1]) <= 100 or attachee.distance_to(game.party[2]) <= 100 or attachee.distance_to(game.party[3]) <= 100 or attachee.distance_to(game.party[4]) <= 100 or attachee.distance_to(game.party[5]) <= 100 or attachee.distance_to(game.party[6]) <= 100 or attachee.distance_to(game.party[7]) <= 100): + if any([attachee.distance_to(pc) <= 100 for pc in game.party]): game.global_vars[748] = game.global_vars[748] + 1 if (attachee.leader_get() == OBJ_HANDLE_NULL): if (game.global_vars[748] == 4): From e47bf5a7cf3e68654ba261235d7cc41af708a2c7 Mon Sep 17 00:00:00 2001 From: DudeMcDude Date: Thu, 29 Sep 2022 11:21:31 +0300 Subject: [PATCH 2/4] Fixed constant size party array access in co8 script --- .../co8fixes/scr/py00323Nulb_village_woman.py | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/tpdatasrc/co8fixes/scr/py00323Nulb_village_woman.py b/tpdatasrc/co8fixes/scr/py00323Nulb_village_woman.py index 842ca7dcf..34f066309 100644 --- a/tpdatasrc/co8fixes/scr/py00323Nulb_village_woman.py +++ b/tpdatasrc/co8fixes/scr/py00323Nulb_village_woman.py @@ -76,28 +76,7 @@ def stop_watch( attachee, triggerer ): def all_dead(): if (game.global_vars[958] == 6): game.global_vars[958] = 7 - pc1 = game.party[0] - pc1.critter_kill_by_effect() - game.particles( "sp-Poison", pc1 ) - pc2 = game.party[1] - pc2.critter_kill_by_effect() - game.particles( "sp-Poison", pc2 ) - pc3 = game.party[2] - pc3.critter_kill_by_effect() - game.particles( "sp-Poison", pc3 ) - pc4 = game.party[3] - pc4.critter_kill_by_effect() - game.particles( "sp-Poison", pc4 ) - pc5 = game.party[4] - pc5.critter_kill_by_effect() - game.particles( "sp-Poison", pc5 ) - pc6 = game.party[5] - pc6.critter_kill_by_effect() - game.particles( "sp-Poison", pc6 ) - pc7 = game.party[6] - pc7.critter_kill_by_effect() - game.particles( "sp-Poison", pc7 ) - pc8 = game.party[7] - pc8.critter_kill_by_effect() - game.particles( "sp-Poison", pc8 ) + for pc in game.party: + pc.critter_kill_by_effect() + game.particles( "sp-Poison", pc ) return 1 \ No newline at end of file From 437f5b79344965ae51e10c8520090f8daccbe699 Mon Sep 17 00:00:00 2001 From: DudeMcDude Date: Thu, 29 Sep 2022 19:25:08 +0300 Subject: [PATCH 3/4] Script error in farmer's wife (used for Co8 troll interrogation?) --- tpdatasrc/co8fixes/scr/py00011farmer wife.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpdatasrc/co8fixes/scr/py00011farmer wife.py b/tpdatasrc/co8fixes/scr/py00011farmer wife.py index c8b20917a..e83f4fc7c 100644 --- a/tpdatasrc/co8fixes/scr/py00011farmer wife.py +++ b/tpdatasrc/co8fixes/scr/py00011farmer wife.py @@ -71,5 +71,5 @@ def run_off( attachee, triggerer ): # attachee.ai_shitlist_remove( pc ) # attachee.reaction_set( pc, 50 ) attachee.runoff(attachee.location-3) - Timed_Destroy(obj, 5000) + Timed_Destroy(attachee, 5000) return RUN_DEFAULT From c042bd4e9105eecee599080181c6201c82204871 Mon Sep 17 00:00:00 2001 From: DudeMcDude Date: Fri, 30 Sep 2022 17:02:23 +0300 Subject: [PATCH 4/4] Fixed Scribe Scroll crash for vanilla ToEE --- TemplePlus/ui/ui_item_creation.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/TemplePlus/ui/ui_item_creation.cpp b/TemplePlus/ui/ui_item_creation.cpp index 173f1176f..4103be951 100644 --- a/TemplePlus/ui/ui_item_creation.cpp +++ b/TemplePlus/ui/ui_item_creation.cpp @@ -962,9 +962,12 @@ void UiItemCreation::CraftScrollWandPotionSetItemSpellData(objHndl objHndItem, o auto baseDescr = description.GetDescriptionString(obj->GetInt32(obj_f_description) ); auto spellName = spellSys.GetSpellName(mScribedScrollSpell); int SPELL_ENUM_AID = 1; - auto aidSpellName = spellSys.GetSpellName(SPELL_ENUM_AID); - auto pos = std::strstr(baseDescr, aidSpellName); - auto endPos = pos + std::strlen(aidSpellName); + auto aidSpellName = std::string(spellSys.GetSpellName(SPELL_ENUM_AID)); + auto pos = std::strstr(baseDescr, aidSpellName.c_str()); + if (!pos) { + pos = std::strstr(baseDescr, tolower(aidSpellName).c_str()); + } + auto endPos = pos + aidSpellName.size(); char newName[1024] = {0,}; auto idx = 0; for (idx = 0; baseDescr + idx < pos; ++idx) {