mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 12:39:59 +00:00
Don't trigger changed flag if a script with no locals is configured
This commit is contained in:
parent
2d17d8f61a
commit
15b486e149
@ -21,6 +21,11 @@ namespace MWScript
|
||||
mFloats.resize (script.mData.mNumFloats, 0);
|
||||
}
|
||||
|
||||
bool Locals::isEmpty() const
|
||||
{
|
||||
return (mShorts.empty() && mLongs.empty() && mFloats.empty());
|
||||
}
|
||||
|
||||
int Locals::getIntVar(const std::string &script, const std::string &var)
|
||||
{
|
||||
Compiler::Locals locals = MWBase::Environment::get().getScriptManager()->getLocals(script);
|
||||
|
@ -20,6 +20,9 @@ namespace MWScript
|
||||
std::vector<Interpreter::Type_Integer> mLongs;
|
||||
std::vector<Interpreter::Type_Float> mFloats;
|
||||
|
||||
/// Are there any locals?
|
||||
bool isEmpty() const;
|
||||
|
||||
void configure (const ESM::Script& script);
|
||||
bool setVarByInt(const std::string& script, const std::string& var, int val);
|
||||
int getIntVar (const std::string& script, const std::string& var); ///< if var does not exist, returns 0
|
||||
|
@ -152,7 +152,8 @@ namespace MWWorld
|
||||
{
|
||||
mLocals.configure (script);
|
||||
mHasLocals = true;
|
||||
mChanged = true;
|
||||
if (!mLocals.isEmpty())
|
||||
mChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user