mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-21 04:20:48 +00:00
Allow disabling objects that have no placed instances (#4289)
This commit is contained in:
parent
6ac0880cf3
commit
24f1feb67a
@ -7,6 +7,7 @@
|
|||||||
Bug #4127: Weapon animation looks choppy
|
Bug #4127: Weapon animation looks choppy
|
||||||
Bug #4204: Dead slaughterfish doesn't float to water surface after loading saved game
|
Bug #4204: Dead slaughterfish doesn't float to water surface after loading saved game
|
||||||
Bug #4207: RestoreHealth/Fatigue spells have a huge priority even if a success chance is near 0
|
Bug #4207: RestoreHealth/Fatigue spells have a huge priority even if a success chance is near 0
|
||||||
|
Bug #4289: Script compilation fails if an NPC deleted in a content file is disabled
|
||||||
Bug #4382: Sound output device does not change when it should
|
Bug #4382: Sound output device does not change when it should
|
||||||
Bug #4508: Can't stack enchantment buffs from different instances of the same self-cast generic magic apparel
|
Bug #4508: Can't stack enchantment buffs from different instances of the same self-cast generic magic apparel
|
||||||
Bug #4610: Casting a Bound Weapon spell cancels the casting animation by equipping the weapon prematurely
|
Bug #4610: Casting a Bound Weapon spell cancels the casting animation by equipping the weapon prematurely
|
||||||
|
@ -254,7 +254,26 @@ namespace MWScript
|
|||||||
public:
|
public:
|
||||||
void execute(Interpreter::Runtime& runtime) override
|
void execute(Interpreter::Runtime& runtime) override
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr;
|
||||||
|
if (!R::implicit)
|
||||||
|
{
|
||||||
|
ESM::RefId name = ESM::RefId::stringRefId(runtime.getStringLiteral(runtime[0].mInteger));
|
||||||
|
runtime.pop();
|
||||||
|
|
||||||
|
ptr = MWBase::Environment::get().getWorld()->searchPtr(name, false);
|
||||||
|
// We don't normally want to let this go, but some mods insist on trying this
|
||||||
|
if (ptr.isEmpty())
|
||||||
|
{
|
||||||
|
const std::string error = "Failed to find an instance of object " + name.toDebugString();
|
||||||
|
runtime.getContext().report(error);
|
||||||
|
Log(Debug::Error) << error;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ptr = R()(runtime);
|
||||||
|
}
|
||||||
MWBase::Environment::get().getWorld()->disable(ptr);
|
MWBase::Environment::get().getWorld()->disable(ptr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user