forked from teamnwah/openmw-tes3coop
[Client] Correctly disable auto-equipping for DedicatedPlayers & DedicatedActors
This commit is contained in:
parent
068a45be87
commit
461ab790e2
1 changed files with 14 additions and 12 deletions
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
Include additional headers for multiplayer purposes
|
Include additional headers for multiplayer purposes
|
||||||
*/
|
*/
|
||||||
|
#include "../mwmp/Main.hpp"
|
||||||
|
#include "../mwmp/CellController.hpp"
|
||||||
#include "../mwmp/PlayerList.hpp"
|
#include "../mwmp/PlayerList.hpp"
|
||||||
/*
|
/*
|
||||||
End of tes3mp addition
|
End of tes3mp addition
|
||||||
|
@ -222,18 +224,6 @@ bool MWWorld::InventoryStore::canActorAutoEquip(const MWWorld::Ptr& actor, const
|
||||||
if (!Settings::Manager::getBool("prevent merchant equipping", "Game"))
|
if (!Settings::Manager::getBool("prevent merchant equipping", "Game"))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/*
|
|
||||||
Start of tes3mp addition
|
|
||||||
|
|
||||||
We need player-controlled NPCs to wear whatever their players are
|
|
||||||
actually wearing, so don't autoequip for them
|
|
||||||
*/
|
|
||||||
if (mwmp::PlayerList::isDedicatedPlayer(actor))
|
|
||||||
return false;
|
|
||||||
/*
|
|
||||||
End of tes3mp addition
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Only autoEquip if we are the original owner of the item.
|
// Only autoEquip if we are the original owner of the item.
|
||||||
// This stops merchants from auto equipping anything you sell to them.
|
// This stops merchants from auto equipping anything you sell to them.
|
||||||
// ...unless this is a companion, he should always equip items given to him.
|
// ...unless this is a companion, he should always equip items given to him.
|
||||||
|
@ -269,6 +259,18 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::findSlot (int slot) con
|
||||||
|
|
||||||
void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
|
void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
We need DedicatedPlayers and DedicatedActors to wear exactly what they're wearing on their
|
||||||
|
authority client, so don't auto-equip for them
|
||||||
|
*/
|
||||||
|
if (mwmp::PlayerList::isDedicatedPlayer(actor) || mwmp::Main::get().getCellController()->isDedicatedActor(actor))
|
||||||
|
return;
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
const MWBase::World *world = MWBase::Environment::get().getWorld();
|
const MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
const MWWorld::Store<ESM::GameSetting> &store = world->getStore().get<ESM::GameSetting>();
|
const MWWorld::Store<ESM::GameSetting> &store = world->getStore().get<ESM::GameSetting>();
|
||||||
MWMechanics::NpcStats& stats = actor.getClass().getNpcStats(actor);
|
MWMechanics::NpcStats& stats = actor.getClass().getNpcStats(actor);
|
||||||
|
|
Loading…
Reference in a new issue