mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-25 14:03:33 -04:00
[Server] Add OnActorAI event and remove autosync for ActorAI packets
This commit is contained in:
parent
8f745df055
commit
837c5369c0
@ -85,12 +85,13 @@ set(SERVER_HEADER
|
|||||||
source_group(tes3mp-server FILES ${SERVER} ${SERVER_HEADER})
|
source_group(tes3mp-server FILES ${SERVER} ${SERVER_HEADER})
|
||||||
|
|
||||||
set(PROCESSORS_ACTOR
|
set(PROCESSORS_ACTOR
|
||||||
processors/actor/ProcessorActorAnimFlags.hpp processors/actor/ProcessorActorAnimPlay.hpp
|
processors/actor/ProcessorActorAI.hpp processors/actor/ProcessorActorAnimFlags.hpp
|
||||||
processors/actor/ProcessorActorAttack.hpp processors/actor/ProcessorActorCellChange.hpp
|
processors/actor/ProcessorActorAnimPlay.hpp processors/actor/ProcessorActorAttack.hpp
|
||||||
processors/actor/ProcessorActorDeath.hpp processors/actor/ProcessorActorEquipment.hpp
|
processors/actor/ProcessorActorCellChange.hpp processors/actor/ProcessorActorDeath.hpp
|
||||||
processors/actor/ProcessorActorInteraction.hpp processors/actor/ProcessorActorList.hpp
|
processors/actor/ProcessorActorEquipment.hpp processors/actor/ProcessorActorInteraction.hpp
|
||||||
processors/actor/ProcessorActorPosition.hpp processors/actor/ProcessorActorSpeech.hpp
|
processors/actor/ProcessorActorList.hpp processors/actor/ProcessorActorPosition.hpp
|
||||||
processors/actor/ProcessorActorStatsDynamic.hpp processors/actor/ProcessorActorTest.hpp
|
processors/actor/ProcessorActorSpeech.hpp processors/actor/ProcessorActorStatsDynamic.hpp
|
||||||
|
processors/actor/ProcessorActorTest.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR})
|
source_group(tes3mp-server\\processors\\actor FILES ${PROCESSORS_ACTOR})
|
||||||
|
@ -192,6 +192,7 @@ public:
|
|||||||
{"OnVideoPlay", Function<void, unsigned short, const char*>()},
|
{"OnVideoPlay", Function<void, unsigned short, const char*>()},
|
||||||
{"OnActorList", Function<void, unsigned short, const char*>()},
|
{"OnActorList", Function<void, unsigned short, const char*>()},
|
||||||
{"OnActorEquipment", 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*>()},
|
{"OnActorDeath", Function<void, unsigned short, const char*>()},
|
||||||
{"OnActorCellChange", Function<void, unsigned short, const char*>()},
|
{"OnActorCellChange", Function<void, unsigned short, const char*>()},
|
||||||
{"OnActorTest", 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
|
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);
|
Cell *serverCell = CellController::get()->getCell(&actorList.cell);
|
||||||
|
|
||||||
if (serverCell != nullptr && *serverCell->getAuthority() == actorList.guid)
|
if (serverCell != nullptr)
|
||||||
serverCell->sendToLoaded(&packet, &actorList);
|
{
|
||||||
|
Script::Call<Script::CallbackIdentity("OnActorAI")>(player.getId(), actorList.cell.getDescription().c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user