mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 01:49:54 +00:00
cd444f8707
Previously, a Container packet with a SET action for an actor would clear their entire InventoryStore, also clearing all of their equipment slots. The actor's authority would then autoEquip new equipment for the actor, but that new equipment would not actually get sent to the other players. As a result, they would see the actor fighting with hand-to-hand attacks, while also not actually wearing anything despite being rendered as wearing the same clothes and armor as before. This commit makes the actor's authority resend the actor's equipment as soon as the Container packet has caused the autoEquip to happen.
58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
#ifndef OPENMW_LOCALACTOR_HPP
|
|
#define OPENMW_LOCALACTOR_HPP
|
|
|
|
#include <components/openmw-mp/Base/BaseActor.hpp>
|
|
#include "../mwmechanics/creaturestats.hpp"
|
|
#include "../mwworld/manualref.hpp"
|
|
|
|
namespace mwmp
|
|
{
|
|
class LocalActor : public BaseActor
|
|
{
|
|
public:
|
|
|
|
LocalActor();
|
|
virtual ~LocalActor();
|
|
|
|
void update(bool forceUpdate);
|
|
|
|
void updateCell();
|
|
void updatePosition(bool forceUpdate);
|
|
void updateAnimFlags(bool forceUpdate);
|
|
void updateAnimPlay();
|
|
void updateSpeech();
|
|
void updateStatsDynamic(bool forceUpdate);
|
|
void updateEquipment(bool forceUpdate, bool sendImmediately = false);
|
|
void updateAttackOrCast();
|
|
|
|
void sendEquipment();
|
|
void sendDeath(char newDeathState);
|
|
|
|
MWWorld::Ptr getPtr();
|
|
void setPtr(const MWWorld::Ptr& newPtr);
|
|
|
|
bool hasSentData;
|
|
|
|
private:
|
|
MWWorld::Ptr ptr;
|
|
|
|
bool posWasChanged;
|
|
bool equipmentChanged;
|
|
|
|
bool wasRunning;
|
|
bool wasSneaking;
|
|
bool wasForceJumping;
|
|
bool wasForceMoveJumping;
|
|
|
|
bool wasJumping;
|
|
bool wasFlying;
|
|
|
|
MWMechanics::DrawState_ lastDrawState;
|
|
|
|
MWMechanics::DynamicStat<float> oldHealth;
|
|
MWMechanics::DynamicStat<float> oldMagicka;
|
|
MWMechanics::DynamicStat<float> oldFatigue;
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_LOCALACTOR_HPP
|