Improve invisibility breaking consistency (bug #7660)

- Break on recharge attempts
- Break on repair attempts
- Break on potion creation attempts
- Don't break on failed ingredient consuming
macos_ci_fix
Alexei Kotov 7 months ago
parent 6d776ac833
commit 2d38ca4c35

@ -85,6 +85,7 @@
Bug #7631: Cannot trade with/talk to Creeper or Mudcrab Merchant when they're fleeing
Bug #7639: NPCs don't use hand-to-hand if their other melee skills were damaged during combat
Bug #7647: NPC walk cycle bugs after greeting player
Bug #7660: Some inconsistencies regarding Invisibility breaking
Feature #3537: Shader-based water ripples
Feature #5492: Let rain and snow collide with statics
Feature #6149: Dehardcode Lua API_REVISION

@ -95,12 +95,16 @@ namespace MWClass
bool Actor::consume(const MWWorld::Ptr& consumable, const MWWorld::Ptr& actor) const
{
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
MWMechanics::CastSpell cast(actor, actor);
const ESM::RefId& recordId = consumable.getCellRef().getRefId();
MWBase::Environment::get().getWorldModel()->registerPtr(consumable);
MWBase::Environment::get().getLuaManager()->itemConsumed(consumable, actor);
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)
return readyStatus;
MWBase::Environment::get().getWorld()->breakInvisibility(mAlchemist);
Result result = Result_RandomFailure;
int brewedCount = 0;
for (int i = 0; i < count; ++i)

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

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

Loading…
Cancel
Save