diff --git a/apps/openmw/mwmp/DedicatedPlayer.cpp b/apps/openmw/mwmp/DedicatedPlayer.cpp index 453115c19..d5f40ea42 100644 --- a/apps/openmw/mwmp/DedicatedPlayer.cpp +++ b/apps/openmw/mwmp/DedicatedPlayer.cpp @@ -239,7 +239,7 @@ void DedicatedPlayer::setShapeshift() if (!isWerewolf) setEquipment(); } - + MWBase::Environment::get().getWorld()->scaleObject(ptr, scale); } diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index d20c3f28a..284300252 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -1596,16 +1596,6 @@ void LocalPlayer::sendBook(const std::string& bookId) getNetworking()->getPlayerPacket(ID_PLAYER_BOOK)->Send(); } -void LocalPlayer::sendScale(float newScale) -{ - scale = newScale; - - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_PLAYER_SHAPESHIFT with scale of %f", scale); - - getNetworking()->getPlayerPacket(ID_PLAYER_SHAPESHIFT)->setPlayer(this); - getNetworking()->getPlayerPacket(ID_PLAYER_SHAPESHIFT)->Send(); -} - void LocalPlayer::sendWerewolfState(bool werewolfState) { isWerewolf = werewolfState; diff --git a/apps/openmw/mwmp/LocalPlayer.hpp b/apps/openmw/mwmp/LocalPlayer.hpp index 36c114da0..8c079b180 100644 --- a/apps/openmw/mwmp/LocalPlayer.hpp +++ b/apps/openmw/mwmp/LocalPlayer.hpp @@ -86,7 +86,6 @@ namespace mwmp void sendTopic(const std::string& topic); void sendKill(const std::string& refId, int number); void sendBook(const std::string& bookId); - void sendScale(float newScale); void sendWerewolfState(bool isWerewolf); void sendMarkLocation(const ESM::Cell& newMarkCell, const ESM::Position& newMarkPosition); void sendSelectedSpell(const std::string& newSelectedSpellId); diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 6c4b3f033..543f59b02 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -6,6 +6,7 @@ Include additional headers for multiplayer purposes */ #include +#include "../mwbase/windowmanager.hpp" #include "../mwmp/Main.hpp" #include "../mwmp/Networking.hpp" #include "../mwmp/LocalPlayer.hpp" @@ -59,19 +60,24 @@ namespace MWScript /* Start of tes3mp addition - Send an ID_PLAYER_SHAPESHIFT every time a player changes - their own scale + Prevent players from changing their own scale - Otherwise, send an ID_OBJECT_SCALE every time an object's + Send an ID_OBJECT_SCALE every time an object's scale is changed through a script */ if (ptr == MWMechanics::getPlayer()) - mwmp::Main::get().getLocalPlayer()->sendScale(scale); - else if (ptr.isInCell() && (ptr.getCellRef().getScale() != scale)) + { + MWBase::Environment::get().getWindowManager()-> + messageBox("You can't change your own scale in multiplayer. Only the server can."); + } + else if (ptr.isInCell() && ptr.getCellRef().getScale() != scale) { // Ignore attempts to change another player's scale if (mwmp::PlayerList::isDedicatedPlayer(ptr)) - return; + { + MWBase::Environment::get().getWindowManager()-> + messageBox("You can't change the scales of other players. Only the server can."); + } else { mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();