mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-13 18:21:42 +00:00
[Client] Avoid packet spam by not giving locals values they already have
This commit is contained in:
parent
76f3805e16
commit
2390e951bb
1 changed files with 20 additions and 0 deletions
|
@ -219,6 +219,16 @@ namespace MWScript
|
|||
if (!mLocals)
|
||||
throw std::runtime_error ("local variables not available in this context");
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Avoid setting a local to a value it already is, preventing packet spam
|
||||
*/
|
||||
if (mLocals->mShorts.at(index) == value) return;
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
mLocals->mShorts.at (index) = value;
|
||||
|
||||
/*
|
||||
|
@ -253,6 +263,16 @@ namespace MWScript
|
|||
if (!mLocals)
|
||||
throw std::runtime_error ("local variables not available in this context");
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Avoid setting a local to a value it already is, preventing packet spam
|
||||
*/
|
||||
if (mLocals->mFloats.at(index) == value) return;
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
mLocals->mFloats.at (index) = value;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue