From c718f8932556505ed7021458550300c6a6592e2f Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Mon, 7 Oct 2019 23:11:09 +0300 Subject: [PATCH] Set OnPCEquip properly when a race can't equip an item (bug #5182) --- CHANGELOG.md | 1 + apps/openmw/mwgui/inventorywindow.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d84a661ee..8bfbe7ef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,6 +155,7 @@ Bug #5169: Nested levelled items/creatures have significantly higher chance not to spawn Bug #5175: Random script function returns an integer value Bug #5177: Editor: Unexplored map tiles get corrupted after a file with terrain is saved + Bug #5182: OnPCEquip doesn't trigger on skipped beast race attempts to equip something not equippable by beasts Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index a3ad5d29a..77ecaca34 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -526,7 +526,11 @@ namespace MWGui if (canEquip.first == 0) { - MWBase::Environment::get().getWindowManager()->messageBox(canEquip.second); + /// If PCSkipEquip is set, set OnPCEquip to 1 and don't message anything + if (!script.empty() && ptr.getRefData().getLocals().getIntVar(script, "pcskipequip") == 1) + ptr.getRefData().getLocals().setVarByInt(script, "onpcequip", 1); + else + MWBase::Environment::get().getWindowManager()->messageBox(canEquip.second); updateItemView(); return; }