Skip to content

Commit

Permalink
Fixed Scribe Scroll crash for vanilla ToEE
Browse files Browse the repository at this point in the history
  • Loading branch information
DudeMcDude committed Sep 30, 2022
1 parent 437f5b7 commit c042bd4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions TemplePlus/ui/ui_item_creation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c042bd4

Please sign in to comment.