mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 15:15:34 +00:00
Added checks for paralysis, knocked down, and death when picking up items from inventory. Fixes #6165
This commit is contained in:
parent
cc642b5335
commit
36657698fb
3 changed files with 9 additions and 0 deletions
|
@ -159,6 +159,7 @@ Programmers
|
||||||
Nikolay Kasyanov (corristo)
|
Nikolay Kasyanov (corristo)
|
||||||
nobrakal
|
nobrakal
|
||||||
Nolan Poe (nopoe)
|
Nolan Poe (nopoe)
|
||||||
|
Nurivan Gomez (Nuri-G)
|
||||||
Oleg Chkan (mrcheko)
|
Oleg Chkan (mrcheko)
|
||||||
Paul Cercueil (pcercuei)
|
Paul Cercueil (pcercuei)
|
||||||
Paul McElroy (Greendogo)
|
Paul McElroy (Greendogo)
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
Bug #6131: Item selection in the avatar window not working correctly for large window sizes
|
Bug #6131: Item selection in the avatar window not working correctly for large window sizes
|
||||||
Bug #6133: Cannot reliably sneak or steal in the sight of the NPCs siding with player
|
Bug #6133: Cannot reliably sneak or steal in the sight of the NPCs siding with player
|
||||||
Bug #6143: Capturing a screenshot makes engine to be a temporary unresponsive
|
Bug #6143: Capturing a screenshot makes engine to be a temporary unresponsive
|
||||||
|
Bug #6165: Paralyzed player character can pickup items when the inventory is open
|
||||||
Feature #2780: A way to see current OpenMW version in the console
|
Feature #2780: A way to see current OpenMW version in the console
|
||||||
Feature #5489: MCP: Telekinesis fix for activators
|
Feature #5489: MCP: Telekinesis fix for activators
|
||||||
Feature #5996: Support Lua scripts in OpenMW
|
Feature #5996: Support Lua scripts in OpenMW
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include "../mwmechanics/actorutil.hpp"
|
#include "../mwmechanics/actorutil.hpp"
|
||||||
#include "../mwmechanics/creaturestats.hpp"
|
#include "../mwmechanics/creaturestats.hpp"
|
||||||
|
#include "../mwmechanics/npcstats.hpp"
|
||||||
|
|
||||||
#include "itemview.hpp"
|
#include "itemview.hpp"
|
||||||
#include "inventoryitemmodel.hpp"
|
#include "inventoryitemmodel.hpp"
|
||||||
|
@ -732,6 +733,12 @@ namespace MWGui
|
||||||
if (!object.getRefData().activate())
|
if (!object.getRefData().activate())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Player must not be paralyzed, knocked down, or dead to pick up an item.
|
||||||
|
const MWMechanics::NpcStats& playerStats = player.getClass().getNpcStats(player);
|
||||||
|
bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
||||||
|
if ((!godmode && playerStats.isParalyzed()) || playerStats.getKnockedDown() || playerStats.isDead())
|
||||||
|
return;
|
||||||
|
|
||||||
MWBase::Environment::get().getMechanicsManager()->itemTaken(player, object, MWWorld::Ptr(), count);
|
MWBase::Environment::get().getMechanicsManager()->itemTaken(player, object, MWWorld::Ptr(), count);
|
||||||
|
|
||||||
// add to player inventory
|
// add to player inventory
|
||||||
|
|
Loading…
Reference in a new issue