mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 03:45:32 +00:00
[Client] Replace usage of Networking::isDedicatedPlayer()
This commit is contained in:
parent
1f6d05dfe5
commit
014ff7a059
6 changed files with 23 additions and 20 deletions
|
@ -14,7 +14,6 @@
|
|||
Include additional headers for multiplayer purposes
|
||||
*/
|
||||
#include "../mwmp/Main.hpp"
|
||||
#include "../mwmp/Networking.hpp"
|
||||
#include "../mwmp/LocalPlayer.hpp"
|
||||
#include "../mwmp/DedicatedPlayer.hpp"
|
||||
/*
|
||||
|
@ -564,9 +563,9 @@ namespace MWClass
|
|||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Ignore hits from DedicatedPlayers
|
||||
Ignore hit calculations on this client from DedicatedPlayers
|
||||
*/
|
||||
if (mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr))
|
||||
if (mwmp::PlayerList::isDedicatedPlayer(ptr))
|
||||
return;
|
||||
/*
|
||||
End of tes3mp addition
|
||||
|
@ -949,7 +948,7 @@ namespace MWClass
|
|||
|
||||
Don't display a dialogue screen for two players interacting with each other
|
||||
*/
|
||||
if (actor == MWMechanics::getPlayer() && mwmp::Main::get().getNetworking()->isDedicatedPlayer(ptr))
|
||||
if (actor == MWMechanics::getPlayer() && mwmp::PlayerList::isDedicatedPlayer(ptr))
|
||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction("Not implemented."));
|
||||
/*
|
||||
End of tes3mp addition
|
||||
|
|
|
@ -4,10 +4,17 @@
|
|||
|
||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||
|
||||
#include "../mwmp/Networking.hpp"
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Include additional headers for multiplayer purposes
|
||||
*/
|
||||
#include "../mwmp/Main.hpp"
|
||||
#include "../mwmp/DedicatedPlayer.hpp"
|
||||
#include "../mwmp/LocalPlayer.hpp"
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -196,7 +203,7 @@ namespace MWMechanics
|
|||
|
||||
Ignore projectiles fired by DedicatedPlayers
|
||||
*/
|
||||
if (mwmp::Main::get().getNetworking()->isDedicatedPlayer(attacker))
|
||||
if (mwmp::PlayerList::isDedicatedPlayer(attacker))
|
||||
return;
|
||||
/*
|
||||
End of tes3mp addition
|
||||
|
|
|
@ -8,9 +8,17 @@
|
|||
|
||||
#include <components/misc/rng.hpp>
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Include additional headers for multiplayer purposes
|
||||
*/
|
||||
#include "../mwmp/Main.hpp"
|
||||
#include "../mwmp/DedicatedPlayer.hpp"
|
||||
#include "../mwmp/LocalPlayer.hpp"
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/soundmanager.hpp"
|
||||
|
|
|
@ -235,10 +235,10 @@ DedicatedPlayer *PlayerList::getPlayer(const MWWorld::Ptr &ptr)
|
|||
|
||||
bool PlayerList::isDedicatedPlayer(const MWWorld::Ptr &ptr)
|
||||
{
|
||||
if (getPlayer(ptr))
|
||||
return true;
|
||||
if (ptr.mRef == 0)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
return (getPlayer(ptr) != 0);
|
||||
}
|
||||
|
||||
void DedicatedPlayer::move(float dt)
|
||||
|
|
|
@ -299,15 +299,6 @@ WorldEvent *Networking::getWorldEvent()
|
|||
return &worldEvent;
|
||||
}
|
||||
|
||||
bool Networking::isDedicatedPlayer(const MWWorld::Ptr &ptr)
|
||||
{
|
||||
if (ptr.mRef == 0)
|
||||
return 0;
|
||||
DedicatedPlayer *pl = PlayerList::getPlayer(ptr);
|
||||
|
||||
return pl != 0;
|
||||
}
|
||||
|
||||
bool Networking::isConnected()
|
||||
{
|
||||
return connected;
|
||||
|
|
|
@ -35,8 +35,6 @@ namespace mwmp
|
|||
ActorPacket *getActorPacket(RakNet::MessageID id);
|
||||
WorldPacket *getWorldPacket(RakNet::MessageID id);
|
||||
|
||||
bool isDedicatedPlayer(const MWWorld::Ptr &ptr);
|
||||
|
||||
RakNet::SystemAddress serverAddress()
|
||||
{
|
||||
return serverAddr;
|
||||
|
|
Loading…
Reference in a new issue