mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
prevent activation, leave the rest to the script
This commit is contained in:
parent
a9e5e19482
commit
bcbfa5fe1e
4 changed files with 3 additions and 16 deletions
|
@ -653,6 +653,9 @@ namespace MWGui
|
|||
if (object.getClass().getName(object) == "") // objects without name presented to user can never be picked up
|
||||
return;
|
||||
|
||||
if (!object.getRefData().activate())
|
||||
return;
|
||||
|
||||
int count = object.getRefData().getCount();
|
||||
|
||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||
|
@ -664,12 +667,6 @@ namespace MWGui
|
|||
// can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object
|
||||
MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player);
|
||||
|
||||
if (object.getRefData().hasSuppressActivate()) // if Flag_SuppressActivate is set, script that contains OnActivate is attached to the item
|
||||
{
|
||||
newObject.getRefData().onActivate(); // set the flag_SuppressActivate flag for the new item
|
||||
newObject.getRefData().activate();
|
||||
}
|
||||
|
||||
// remove from world
|
||||
MWBase::Environment::get().getWorld()->deleteObject (object);
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ namespace MWWorld
|
|||
|
||||
void ActionTake::executeImp (const Ptr& actor)
|
||||
{
|
||||
//No need to do anything if moving items from the player's inventory back into player's inventory
|
||||
if (actor == MWBase::Environment::get().getWorld()->getPlayerPtr() && getTarget().getCell() == 0)
|
||||
return;
|
||||
MWBase::Environment::get().getMechanicsManager()->itemTaken(
|
||||
actor, getTarget(), MWWorld::Ptr(), getTarget().getRefData().getCount());
|
||||
MWWorld::Ptr newitem = *actor.getClass().getContainerStore (actor).add (getTarget(), getTarget().getRefData().getCount(), actor);
|
||||
|
|
|
@ -192,11 +192,6 @@ namespace MWWorld
|
|||
return mEnabled;
|
||||
}
|
||||
|
||||
bool RefData::hasSuppressActivate()
|
||||
{
|
||||
return mFlags & Flag_SuppressActivate;
|
||||
}
|
||||
|
||||
void RefData::enable()
|
||||
{
|
||||
if (!mEnabled)
|
||||
|
|
|
@ -111,8 +111,6 @@ namespace MWWorld
|
|||
|
||||
bool isEnabled() const;
|
||||
|
||||
bool hasSuppressActivate();
|
||||
|
||||
void enable();
|
||||
|
||||
void disable();
|
||||
|
|
Loading…
Reference in a new issue