mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-28 11:39:40 +00:00
[Server] Add OnActorAI event and remove autosync for ActorAI packets
This commit is contained in:
parent
8f745df055
commit
837c5369c0
3 changed files with 12 additions and 9 deletions
|
@ -85,12 +85,13 @@ set(SERVER_HEADER
|
|||
source_group(tes3mp-server FILES ${SERVER} ${SERVER_HEADER})
|
||||
|
||||
set(PROCESSORS_ACTOR
|
||||
processors/actor/ProcessorActorAnimFlags.hpp processors/actor/ProcessorActorAnimPlay.hpp
|
||||
processors/actor/ProcessorActorAttack.hpp processors/actor/ProcessorActorCellChange.hpp
|
||||
processors/actor/ProcessorActorDeath.hpp processors/actor/ProcessorActorEquipment.hpp
|
||||
processors/actor/ProcessorActorInteraction.hpp processors/actor/ProcessorActorList.hpp
|
||||
processors/actor/ProcessorActorPosition.hpp processors/actor/ProcessorActorSpeech.hpp
|
||||
processors/actor/ProcessorActorStatsDynamic.hpp processors/actor/ProcessorActorTest.hpp
|
||||
processors/actor/ProcessorActorAI.hpp processors/actor/ProcessorActorAnimFlags.hpp
|
||||
processors/actor/ProcessorActorAnimPlay.hpp processors/actor/ProcessorActorAttack.hpp
|
||||
processors/actor/ProcessorActorCellChange.hpp processors/actor/ProcessorActorDeath.hpp
|
||||
processors/actor/ProcessorActorEquipment.hpp processors/actor/ProcessorActorInteraction.hpp
|
||||
processors/actor/ProcessorActorList.hpp processors/actor/ProcessorActorPosition.hpp
|
||||
processors/actor/ProcessorActorSpeech.hpp processors/actor/ProcessorActorStatsDynamic.hpp
|
||||
processors/actor/ProcessorActorTest.hpp
|
||||
)
|
||||
|
||||
source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR})
|
||||
|
|
|
@ -192,6 +192,7 @@ public:
|
|||
{"OnVideoPlay", Function<void, unsigned short, const char*>()},
|
||||
{"OnActorList", Function<void, unsigned short, const char*>()},
|
||||
{"OnActorEquipment", Function<void, unsigned short, const char*>()},
|
||||
{"OnActorAI", Function<void, unsigned short, const char*>()},
|
||||
{"OnActorDeath", Function<void, unsigned short, const char*>()},
|
||||
{"OnActorCellChange", Function<void, unsigned short, const char*>()},
|
||||
{"OnActorTest", Function<void, unsigned short, const char*>()},
|
||||
|
|
|
@ -15,11 +15,12 @@ namespace mwmp
|
|||
|
||||
void Do(ActorPacket &packet, Player &player, BaseActorList &actorList) override
|
||||
{
|
||||
// Send only to players who have the cell loaded
|
||||
Cell *serverCell = CellController::get()->getCell(&actorList.cell);
|
||||
|
||||
if (serverCell != nullptr && *serverCell->getAuthority() == actorList.guid)
|
||||
serverCell->sendToLoaded(&packet, &actorList);
|
||||
if (serverCell != nullptr)
|
||||
{
|
||||
Script::Call<Script::CallbackIdentity("OnActorAI")>(player.getId(), actorList.cell.getDescription().c_str());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue