Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Equip command stack overflow (bug #3072) #1875

Merged
merged 2 commits into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Bug #2872: Tab completion in console doesn't work with explicit reference
Bug #2971: Compiler did not reject lines with naked expressions beginning with x.y
Bug #3049: Drain and Fortify effects are not properly applied on health, magicka and fatigue
Bug #3072: Fatal error on AddItem <item> that has a script containing Equip <item>
Bug #3249: Fixed revert function not updating views properly
Bug #3374: Touch spells not hitting kwama foragers
Bug #3486: [Mod] NPC Commands does not work
Expand Down
2 changes: 1 addition & 1 deletion apps/openmw/mwgui/inventorywindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ namespace MWGui

// Give the script a chance to run once before we do anything else
// this is important when setting pcskipequip as a reaction to onpcequip being set (bk_treasuryreport does this)
if (!script.empty() && MWBase::Environment::get().getWorld()->getScriptsEnabled())
if (!force && !script.empty() && MWBase::Environment::get().getWorld()->getScriptsEnabled())
{
MWScript::InterpreterContext interpreterContext (&ptr.getRefData().getLocals(), ptr);
MWBase::Environment::get().getScriptManager()->run (script, interpreterContext);
Expand Down
5 changes: 3 additions & 2 deletions apps/openmw/mwscript/containerextensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ namespace MWScript
if (it == invStore.end())
{
it = ptr.getClass().getContainerStore (ptr).add (item, 1, ptr);
Log(Debug::Warning) << "Implicitly adding one " << item << " to container "
"to fulfil requirements of Equip instruction";
Log(Debug::Warning) << "Implicitly adding one " << item <<
" to the inventory store of " << ptr.getCellRef().getRefId() <<
" to fulfill the requirements of Equip instruction";
}

if (ptr == MWMechanics::getPlayer())
Expand Down