mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-10-01 00:50:15 -04:00
[Client] Avoid packet spam by not giving locals values they already have
This commit is contained in:
parent
76f3805e16
commit
2390e951bb
@ -219,6 +219,16 @@ namespace MWScript
|
|||||||
if (!mLocals)
|
if (!mLocals)
|
||||||
throw std::runtime_error ("local variables not available in this context");
|
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;
|
mLocals->mShorts.at (index) = value;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -253,6 +263,16 @@ namespace MWScript
|
|||||||
if (!mLocals)
|
if (!mLocals)
|
||||||
throw std::runtime_error ("local variables not available in this context");
|
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;
|
mLocals->mFloats.at (index) = value;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user