forked from mirror/openmw-tes3mp
Don't send packets for floating objects
This commit is contained in:
parent
b1051255e0
commit
cc40b85034
1 changed files with 28 additions and 18 deletions
|
@ -570,6 +570,10 @@ namespace MWScript
|
||||||
float az = ptr.getRefData().getPosition().rot[2];
|
float az = ptr.getRefData().getPosition().rot[2];
|
||||||
|
|
||||||
// Added by tes3mp
|
// 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();
|
mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent();
|
||||||
event->cell = *ptr.getCell()->getCell();
|
event->cell = *ptr.getCell()->getCell();
|
||||||
event->cellRef.mRefID = ptr.getCellRef().getRefId();
|
event->cellRef.mRefID = ptr.getCellRef().getRefId();
|
||||||
|
@ -582,6 +586,7 @@ namespace MWScript
|
||||||
printf("Sending ID_OBJECT_ROTATE about %s\n%i\n",
|
printf("Sending ID_OBJECT_ROTATE about %s\n%i\n",
|
||||||
event->cellRef.mRefID.c_str(),
|
event->cellRef.mRefID.c_str(),
|
||||||
event->cellRef.mRefNum.mIndex);
|
event->cellRef.mRefNum.mIndex);
|
||||||
|
}
|
||||||
|
|
||||||
if (axis == "x")
|
if (axis == "x")
|
||||||
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax+rotation,ay,az);
|
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax+rotation,ay,az);
|
||||||
|
@ -662,6 +667,10 @@ namespace MWScript
|
||||||
float zr = ptr.getCellRef().getPosition().rot[2];
|
float zr = ptr.getCellRef().getPosition().rot[2];
|
||||||
|
|
||||||
// Added by tes3mp
|
// 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();
|
mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent();
|
||||||
event->cell = *ptr.getCell()->getCell();
|
event->cell = *ptr.getCell()->getCell();
|
||||||
event->cellRef.mRefID = ptr.getCellRef().getRefId();
|
event->cellRef.mRefID = ptr.getCellRef().getRefId();
|
||||||
|
@ -669,6 +678,7 @@ namespace MWScript
|
||||||
event->pos = ptr.getCellRef().getPosition();
|
event->pos = ptr.getCellRef().getPosition();
|
||||||
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_ROTATE)->Send(event);
|
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_ROTATE)->Send(event);
|
||||||
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_MOVE)->Send(event);
|
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_MOVE)->Send(event);
|
||||||
|
}
|
||||||
|
|
||||||
MWBase::Environment::get().getWorld()->rotateObject(ptr, xr, yr, zr);
|
MWBase::Environment::get().getWorld()->rotateObject(ptr, xr, yr, zr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue