Don't send packets for floating objects

This commit is contained in:
David Cernat 2016-10-25 16:30:31 +03:00
parent b1051255e0
commit cc40b85034

View file

@ -570,6 +570,10 @@ namespace MWScript
float az = ptr.getRefData().getPosition().rot[2];
// Added by tes3mp
//
// Only send packet for objects that don't have the spammy Float script
if (!Misc::StringUtils::ciEqual(ptr.getClass().getScript(ptr), "Float"))
{
mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent();
event->cell = *ptr.getCell()->getCell();
event->cellRef.mRefID = ptr.getCellRef().getRefId();
@ -582,6 +586,7 @@ namespace MWScript
printf("Sending ID_OBJECT_ROTATE about %s\n%i\n",
event->cellRef.mRefID.c_str(),
event->cellRef.mRefNum.mIndex);
}
if (axis == "x")
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax+rotation,ay,az);
@ -662,6 +667,10 @@ namespace MWScript
float zr = ptr.getCellRef().getPosition().rot[2];
// Added by tes3mp
//
// Only send packet for objects that don't have the spammy Float script
if (!Misc::StringUtils::ciEqual(ptr.getClass().getScript(ptr), "Float"))
{
mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent();
event->cell = *ptr.getCell()->getCell();
event->cellRef.mRefID = ptr.getCellRef().getRefId();
@ -669,6 +678,7 @@ namespace MWScript
event->pos = ptr.getCellRef().getPosition();
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_ROTATE)->Send(event);
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_MOVE)->Send(event);
}
MWBase::Environment::get().getWorld()->rotateObject(ptr, xr, yr, zr);