1
0
Fork 1
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:
David Cernat 2020-02-13 07:50:12 +02:00
parent 76f3805e16
commit 2390e951bb

View file

@ -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;
/*