mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat(moving platform): simple movers and rotaters, chosen as the client chooses
The subcomponent comes from the platformIsMover, platformIsSimpleMover and platformIsRotater settings; with none set, a platform without a registry component is a mover and one with a registry component a simple mover (also when it has an attached path, so the registry ID is passed then too). All flags set false means no subcomponent. A simple mover reads its MovingPlatforms row and the platformMove* settings, is always constructed with its starting point and state as live did, and travels between its start and start + platformMove in platformMoveTime. A rotater is written as type 6 with a mover's data. On arrival platforms fire OnWaypointReached, then OnArrivedAtDesiredWaypoint at the waypoint they were sent to and OnPlatformAtLastWaypoint at an end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -787,7 +787,8 @@ void Entity::Initialize() {
|
||||
if (path) {
|
||||
// if we have a moving platform path, then we need a moving platform component
|
||||
if (path->pathType == PathType::MovingPlatform) {
|
||||
AddComponent<MovingPlatformComponent>(-1, pathName);
|
||||
// The registry component ID picks the subcomponent (a simple mover when it has one), path or not
|
||||
AddComponent<MovingPlatformComponent>(compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::MOVING_PLATFORM, -1), pathName);
|
||||
} else if (path->pathType == PathType::Movement) {
|
||||
auto* const movementAIcomponent = GetComponent<MovementAIComponent>();
|
||||
if (movementAIcomponent && combatAiID == 0) {
|
||||
|
||||
Reference in New Issue
Block a user