[General] Make ID_OBJECT_PLACE take effect only when sent back by server

This commit is contained in:
David Cernat 2017-04-04 11:43:33 +03:00
parent 2bd81c3de0
commit 8b8c01f389
3 changed files with 25 additions and 0 deletions

View file

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

View file

@ -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;
}

View file

@ -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)
*/
}
}
};