mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-23 12:38:52 -04:00
[Client] Fix packetOrigin comparisons when sending ObjectState
This commit is contained in:
parent
01208ba90c
commit
81251675a4
@ -200,12 +200,12 @@ namespace MWScript
|
|||||||
last packet regarding its state did not already attempt to enable it (to prevent
|
last packet regarding its state did not already attempt to enable it (to prevent
|
||||||
packet spam)
|
packet spam)
|
||||||
*/
|
*/
|
||||||
if (mwmp::Main::get().getLocalPlayer()->isLoggedIn())
|
if (mwmp::Main::get().getLocalPlayer()->isLoggedIn() && ptr.isInCell())
|
||||||
{
|
{
|
||||||
unsigned char packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
|
unsigned char packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
|
||||||
|
|
||||||
if (packetOrigin == Interpreter::Context::CONSOLE || packetOrigin == Interpreter::Context::DIALOGUE ||
|
if (packetOrigin == mwmp::CLIENT_CONSOLE || packetOrigin == mwmp::CLIENT_DIALOGUE ||
|
||||||
(ptr.isInCell() && ptr.getRefData().getLastCommunicatedState() != MWWorld::RefData::StateCommunication::Enabled))
|
ptr.getRefData().getLastCommunicatedState() != MWWorld::RefData::StateCommunication::Enabled)
|
||||||
{
|
{
|
||||||
ptr.getRefData().setLastCommunicatedState(MWWorld::RefData::StateCommunication::Enabled);
|
ptr.getRefData().setLastCommunicatedState(MWWorld::RefData::StateCommunication::Enabled);
|
||||||
|
|
||||||
@ -251,12 +251,12 @@ namespace MWScript
|
|||||||
last packet regarding its state did not already attempt to disable it (to prevent
|
last packet regarding its state did not already attempt to disable it (to prevent
|
||||||
packet spam)
|
packet spam)
|
||||||
*/
|
*/
|
||||||
if (mwmp::Main::get().getLocalPlayer()->isLoggedIn())
|
if (mwmp::Main::get().getLocalPlayer()->isLoggedIn() && ptr.isInCell())
|
||||||
{
|
{
|
||||||
unsigned char packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
|
unsigned char packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
|
||||||
|
|
||||||
if (packetOrigin == Interpreter::Context::CONSOLE || packetOrigin == Interpreter::Context::DIALOGUE ||
|
if (packetOrigin == mwmp::CLIENT_CONSOLE || packetOrigin == mwmp::CLIENT_DIALOGUE ||
|
||||||
(ptr.isInCell() && ptr.getRefData().getLastCommunicatedState() != MWWorld::RefData::StateCommunication::Disabled))
|
ptr.getRefData().getLastCommunicatedState() != MWWorld::RefData::StateCommunication::Disabled)
|
||||||
{
|
{
|
||||||
ptr.getRefData().setLastCommunicatedState(MWWorld::RefData::StateCommunication::Disabled);
|
ptr.getRefData().setLastCommunicatedState(MWWorld::RefData::StateCommunication::Disabled);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user