forked from teamnwah/openmw-tes3coop
Don't trigger changed flag if a script with no locals is configured
This commit is contained in:
parent
2d17d8f61a
commit
15b486e149
3 changed files with 10 additions and 1 deletions
|
@ -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,6 +152,7 @@ namespace MWWorld
|
|||
{
|
||||
mLocals.configure (script);
|
||||
mHasLocals = true;
|
||||
if (!mLocals.isEmpty())
|
||||
mChanged = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue