Merge branch 'invisibilityagain' into 'master'

Improve invisibility breaking consistency (bug #7660)

Closes #7660

See merge request OpenMW/openmw!3539
macos_ci_fix
Evil Eye 1 year ago
commit 3baefdf29e

@ -90,6 +90,7 @@
Bug #7639: NPCs don't use hand-to-hand if their other melee skills were damaged during combat Bug #7639: NPCs don't use hand-to-hand if their other melee skills were damaged during combat
Bug #7642: Items in repair and recharge menus aren't sorted alphabetically Bug #7642: Items in repair and recharge menus aren't sorted alphabetically
Bug #7647: NPC walk cycle bugs after greeting player Bug #7647: NPC walk cycle bugs after greeting player
Bug #7660: Some inconsistencies regarding Invisibility breaking
Feature #3537: Shader-based water ripples Feature #3537: Shader-based water ripples
Feature #5492: Let rain and snow collide with statics Feature #5492: Let rain and snow collide with statics
Feature #6149: Dehardcode Lua API_REVISION Feature #6149: Dehardcode Lua API_REVISION

@ -95,12 +95,16 @@ namespace MWClass
bool Actor::consume(const MWWorld::Ptr& consumable, const MWWorld::Ptr& actor) const bool Actor::consume(const MWWorld::Ptr& consumable, const MWWorld::Ptr& actor) const
{ {
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
MWMechanics::CastSpell cast(actor, actor); MWMechanics::CastSpell cast(actor, actor);
const ESM::RefId& recordId = consumable.getCellRef().getRefId(); const ESM::RefId& recordId = consumable.getCellRef().getRefId();
MWBase::Environment::get().getWorldModel()->registerPtr(consumable); MWBase::Environment::get().getWorldModel()->registerPtr(consumable);
MWBase::Environment::get().getLuaManager()->itemConsumed(consumable, actor); MWBase::Environment::get().getLuaManager()->itemConsumed(consumable, actor);
actor.getClass().getContainerStore(actor).remove(consumable, 1); actor.getClass().getContainerStore(actor).remove(consumable, 1);
return cast.cast(recordId); if (cast.cast(recordId))
{
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
return true;
}
return false;
} }
} }

@ -510,6 +510,8 @@ MWMechanics::Alchemy::Result MWMechanics::Alchemy::create(const std::string& nam
if (readyStatus != Result_Success) if (readyStatus != Result_Success)
return readyStatus; return readyStatus;
MWBase::Environment::get().getWorld()->breakInvisibility(mAlchemist);
Result result = Result_RandomFailure; Result result = Result_RandomFailure;
int brewedCount = 0; int brewedCount = 0;
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)

@ -44,6 +44,8 @@ namespace MWMechanics
MWWorld::Ptr player = MWMechanics::getPlayer(); MWWorld::Ptr player = MWMechanics::getPlayer();
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player); MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
MWBase::Environment::get().getWorld()->breakInvisibility(player);
float luckTerm = 0.1f * stats.getAttribute(ESM::Attribute::Luck).getModified(); float luckTerm = 0.1f * stats.getAttribute(ESM::Attribute::Luck).getModified();
if (luckTerm < 1 || luckTerm > 10) if (luckTerm < 1 || luckTerm > 10)
luckTerm = 1; luckTerm = 1;

@ -22,6 +22,8 @@ namespace MWMechanics
MWWorld::Ptr player = getPlayer(); MWWorld::Ptr player = getPlayer();
MWWorld::LiveCellRef<ESM::Repair>* ref = mTool.get<ESM::Repair>(); MWWorld::LiveCellRef<ESM::Repair>* ref = mTool.get<ESM::Repair>();
MWBase::Environment::get().getWorld()->breakInvisibility(player);
// unstack tool if required // unstack tool if required
player.getClass().getContainerStore(player).unstack(mTool); player.getClass().getContainerStore(player).unstack(mTool);

Loading…
Cancel
Save