[VR Client] Use ObjectActivate when activating objects in VR

0.8.0-vr
David Cernat 3 years ago
parent 7381e6bf60
commit 12b149c598

@ -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
{

@ -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()

Loading…
Cancel
Save