mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Use more accurate position for ID_OBJECT_PLACE
This commit is contained in:
parent
a4647de048
commit
41504bd02a
4 changed files with 11 additions and 4 deletions
|
@ -68,7 +68,10 @@ namespace MWGui
|
||||||
event->cell = *dropped.getCell()->getCell();
|
event->cell = *dropped.getCell()->getCell();
|
||||||
event->cellRef.mRefID = dropped.getCellRef().getRefId();
|
event->cellRef.mRefID = dropped.getCellRef().getRefId();
|
||||||
event->cellRef.mRefNum = dropped.getCellRef().getRefNum();
|
event->cellRef.mRefNum = dropped.getCellRef().getRefNum();
|
||||||
event->cellRef.mPos = dropped.getCellRef().getPosition();
|
|
||||||
|
// Make sure we send the RefData position instead of the CellRef one, because that's what
|
||||||
|
// we actually see on this client
|
||||||
|
event->pos = dropped.getRefData().getPosition();
|
||||||
|
|
||||||
// We have to get the count from the dropped object because it gets changed
|
// We have to get the count from the dropped object because it gets changed
|
||||||
// automatically for stacks of gold
|
// automatically for stacks of gold
|
||||||
|
|
|
@ -719,7 +719,7 @@ void Networking::ProcessWorldPacket(RakNet::Packet *packet)
|
||||||
|
|
||||||
newPtr.getCellRef().setGoldValue(event->cellRef.mGoldValue);
|
newPtr.getCellRef().setGoldValue(event->cellRef.mGoldValue);
|
||||||
|
|
||||||
newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, ptrCellStore, event->cellRef.mPos);
|
newPtr = MWBase::Environment::get().getWorld()->placeObject(newPtr, ptrCellStore, event->pos);
|
||||||
|
|
||||||
// Change RefNum here because the line above unsets it
|
// Change RefNum here because the line above unsets it
|
||||||
newPtr.getCellRef().setRefNumIndex(event->cellRef.mRefNum.mIndex);
|
newPtr.getCellRef().setRefNumIndex(event->cellRef.mRefNum.mIndex);
|
||||||
|
|
|
@ -549,7 +549,11 @@ namespace MWScript
|
||||||
event->cell = *ptr.getCell()->getCell();
|
event->cell = *ptr.getCell()->getCell();
|
||||||
event->cellRef.mRefID = ptr.getCellRef().getRefId();
|
event->cellRef.mRefID = ptr.getCellRef().getRefId();
|
||||||
event->cellRef.mRefNum = ptr.getCellRef().getRefNum();
|
event->cellRef.mRefNum = ptr.getCellRef().getRefNum();
|
||||||
event->cellRef.mPos = ptr.getCellRef().getPosition();
|
|
||||||
|
// Make sure we send the RefData position instead of the CellRef one, because that's what
|
||||||
|
// we actually see on this client
|
||||||
|
event->pos = ptr.getRefData().getPosition();
|
||||||
|
|
||||||
event->count = 1;
|
event->count = 1;
|
||||||
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_PLACE)->Send(event);
|
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_OBJECT_PLACE)->Send(event);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, WorldEvent *event, bool se
|
||||||
|
|
||||||
RW(event->cellRef.mRefID, send);
|
RW(event->cellRef.mRefID, send);
|
||||||
RW(event->cellRef.mRefNum.mIndex, send);
|
RW(event->cellRef.mRefNum.mIndex, send);
|
||||||
RW(event->cellRef.mPos, send);
|
|
||||||
RW(event->cellRef.mGoldValue, send);
|
RW(event->cellRef.mGoldValue, send);
|
||||||
|
|
||||||
RW(event->cell.mData.mFlags, send);
|
RW(event->cell.mData.mFlags, send);
|
||||||
|
@ -22,5 +21,6 @@ void PacketObjectPlace::Packet(RakNet::BitStream *bs, WorldEvent *event, bool se
|
||||||
RW(event->cell.mData.mY, send);
|
RW(event->cell.mData.mY, send);
|
||||||
RW(event->cell.mName, send);
|
RW(event->cell.mName, send);
|
||||||
|
|
||||||
|
RW(event->pos, send);
|
||||||
RW(event->count, send);
|
RW(event->count, send);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue