forked from teamnwah/openmw-tes3coop
[General] Make ID_OBJECT_PLACE take effect only when sent back by server
This commit is contained in:
parent
2bd81c3de0
commit
8b8c01f389
3 changed files with 25 additions and 0 deletions
|
@ -25,6 +25,9 @@ namespace mwmp
|
|||
event.objectChanges.objects.at(i).mpNum = mwmp::Networking::getPtr()->getNextMpNum();
|
||||
}
|
||||
|
||||
// Send this packet back to the original sender with the mpNum generation from above,
|
||||
// then send it to the other players
|
||||
packet.Send(false);
|
||||
packet.Send(true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnObjectPlace")>(player.getId(), event.cell.getDescription().c_str());
|
||||
|
|
|
@ -95,6 +95,17 @@ namespace MWGui
|
|||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
/*
|
||||
Start of tes3mp change (major)
|
||||
|
||||
Instead of actually keeping this object as is, delete it after sending the packet
|
||||
and wait for the server to send it back with the correct mpNum
|
||||
*/
|
||||
MWBase::Environment::get().getWorld()->deleteObject(dropped);
|
||||
/*
|
||||
End of tes3mp change (major)
|
||||
*/
|
||||
|
||||
return dropped;
|
||||
}
|
||||
|
||||
|
|
|
@ -581,6 +581,17 @@ namespace MWScript
|
|||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
/*
|
||||
Start of tes3mp change (major)
|
||||
|
||||
Instead of actually keeping this object as is, delete it after sending the packet
|
||||
and wait for the server to send it back with the correct mpNum
|
||||
*/
|
||||
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
||||
/*
|
||||
End of tes3mp change (major)
|
||||
*/
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue