[General] Set actor data correctly

This commit is contained in:
David Cernat 2017-04-10 07:22:03 +03:00
parent 69bf2749a5
commit a5d0486c82
4 changed files with 8 additions and 6 deletions

View file

@ -103,7 +103,7 @@ void Cell::readCellFrame(ActorList& actorList)
if (dedicatedActors.count(mapIndex) > 0) if (dedicatedActors.count(mapIndex) > 0)
{ {
DedicatedActor *actor = dedicatedActors[mapIndex]; DedicatedActor *actor = dedicatedActors[mapIndex];
actor->position = baseActor.pos; actor->position = baseActor.position;
actor->drawState = baseActor.drawState; actor->drawState = baseActor.drawState;
actor->headPitch = baseActor.headPitch; actor->headPitch = baseActor.headPitch;

View file

@ -50,4 +50,8 @@ MWWorld::Ptr LocalActor::getPtr()
void LocalActor::setPtr(const MWWorld::Ptr& newPtr) void LocalActor::setPtr(const MWWorld::Ptr& newPtr)
{ {
ptr = newPtr; ptr = newPtr;
refId = newPtr.getCellRef().getRefId();
refNumIndex = newPtr.getCellRef().getRefNum().mIndex;
mpNum = newPtr.getCellRef().getMpNum();
} }

View file

@ -20,14 +20,12 @@ namespace mwmp
int refNumIndex; int refNumIndex;
int mpNum; int mpNum;
ESM::Position pos; ESM::Position position;
ESM::Cell cell;
char drawState; char drawState;
bool isFlying; bool isFlying;
ESM::Position position;
ESM::Cell cell;
float headPitch; float headPitch;
float headYaw; float headYaw;

View file

@ -37,7 +37,7 @@ void PacketActorFrame::Packet(RakNet::BitStream *bs, bool send)
RW(actor.refId, send); RW(actor.refId, send);
RW(actor.refNumIndex, send); RW(actor.refNumIndex, send);
RW(actor.mpNum, send); RW(actor.mpNum, send);
RW(actor.pos, send); RW(actor.position, send);
RW(actor.drawState, send); RW(actor.drawState, send);
RW(actor.headPitch, send); RW(actor.headPitch, send);