1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

[Client] Add generic objects to ObjectList using addObjectGeneric()

This commit is contained in:
David Cernat 2020-01-23 09:03:40 +02:00
parent 989188c171
commit 59a38164ea
8 changed files with 15 additions and 8 deletions

View file

@ -415,7 +415,7 @@ namespace MWGui
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObject(objectList->getObjectFromPtr(mPtr));
objectList->addObjectGeneric(mPtr);
objectList->sendObjectDelete();
/*
End of tes3mp change (major)

View file

@ -2,8 +2,6 @@
#include <algorithm>
#include <components/openmw-mp/TimedLog.hpp>
/*
Start of tes3mp addition
@ -209,7 +207,7 @@ void ContainerItemModel::removeItem (const ItemStack& item, size_t count)
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObject(objectList->getObjectFromPtr(source));
objectList->addObjectGeneric(source);
objectList->sendObjectDelete();
/*
End of tes3mp addition

View file

@ -774,7 +774,7 @@ namespace MWGui
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObject(objectList->getObjectFromPtr(object));
objectList->addObjectGeneric(object);
objectList->sendObjectDelete();
/*
End of tes3mp addition

View file

@ -2119,7 +2119,7 @@ namespace MWMechanics
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObject(objectList->getObjectFromPtr(ptr));
objectList->addObjectGeneric(ptr);
objectList->sendObjectDelete();
}
/*

View file

@ -969,6 +969,14 @@ void ObjectList::addRequestedContainers(MWWorld::CellStore* cellStore, const std
}
}
void ObjectList::addObjectGeneric(const MWWorld::Ptr& ptr)
{
cell = *ptr.getCell()->getCell();
mwmp::BaseObject baseObject = getObjectFromPtr(ptr);
addObject(baseObject);
}
void ObjectList::addObjectActivate(const MWWorld::Ptr& ptr, const MWWorld::Ptr& activatingActor)
{
cell = *ptr.getCell()->getCell();

View file

@ -52,6 +52,7 @@ namespace mwmp
void addAllContainers(MWWorld::CellStore* cellStore);
void addRequestedContainers(MWWorld::CellStore* cellStore, const std::vector<BaseObject>& requestObjects);
void addObjectGeneric(const MWWorld::Ptr& ptr);
void addObjectActivate(const MWWorld::Ptr& ptr, const MWWorld::Ptr& activatingActor);
void addObjectHit(const MWWorld::Ptr& ptr, const MWWorld::Ptr& hittingActor);
void addObjectHit(const MWWorld::Ptr& ptr, const MWWorld::Ptr& hittingActor, const Attack hitAttack);

View file

@ -828,7 +828,7 @@ namespace MWScript
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = ScriptController::getPacketOriginFromContextType(runtime.getContext().getContextType());
objectList->addObject(objectList->getObjectFromPtr(ptr));
objectList->addObjectGeneric(ptr);
objectList->sendObjectDelete();
}
/*

View file

@ -52,7 +52,7 @@ namespace MWWorld
mwmp::ObjectList *objectList = mwmp::Main::get().getNetworking()->getObjectList();
objectList->reset();
objectList->packetOrigin = mwmp::CLIENT_GAMEPLAY;
objectList->addObject(objectList->getObjectFromPtr(getTarget()));
objectList->addObjectGeneric(getTarget());
objectList->sendObjectDelete();
/*
End of tes3mp addition