1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-07-01 14:21:34 +00:00

[VR Client] Use ObjectActivate when activating objects in VR

This commit is contained in:
David Cernat 2022-04-30 21:30:11 +03:00
parent 7381e6bf60
commit 12b149c598
2 changed files with 38 additions and 2 deletions

View file

@ -186,7 +186,25 @@ namespace MWVR
{
if (wm->getMode() != MWGui::GM_Container && wm->getMode() != MWGui::GM_Inventory)
return;
wm->getInventoryWindow()->pickUpObject(ptr);
/*
Start of tes3mp change (major)
Disable unilateral picking up of objects on this client
Instead, send an ID_OBJECT_ACTIVATE packet every time an attempt is made to pick up
an item here and expect the server's reply to our packet to cause the actual
picking up of items
*/
//wm->getInventoryWindow()->pickUpObject(ptr);
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectActivate(ptr, MWMechanics::getPlayer());
objectList->sendObjectActivate();
/*
End of tes3mp change (major)
*/
}
else
{

View file

@ -237,7 +237,25 @@ namespace MWWorld
void Player::activate(MWWorld::Ptr obj)
{
MWBase::Environment::get().getWorld()->activate(obj, getPlayer());
/*
Start of tes3mp change (major)
Disable unilateral activating of objects on this client
Instead, send an ID_OBJECT_ACTIVATE packet every time an attempt to activate
an object is made here and expect the server's reply to our packet to cause
the actual activation of objects
*/
//MWBase::Environment::get().getWorld()->activate(obj, getPlayer());
mwmp::ObjectList* objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObjectActivate(obj, MWMechanics::getPlayer());
objectList->sendObjectActivate();
/*
End of tes3mp change (major)
*/
}
void Player::activate()