mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-20 10:45:27 +00:00
feat(entity): player forced movement (106) from the registry, written where the client reads it
The client makes 106 from the registry; the only non-character LOT with it (16684, a test skateboard mount) now has one and writes it between the pet and the character, the client's place for it. A character still writes it with its other parts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -994,6 +994,12 @@ void Entity::Initialize() {
|
|||||||
if (id > -1) AddComponent<HFLightDirectionGadgetComponent>(id);
|
if (id > -1) AddComponent<HFLightDirectionGadgetComponent>(id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case eReplicaComponentType::PLAYER_FORCED_MOVEMENT: {
|
||||||
|
// From the registry, as the client makes it (a character got one with its character component)
|
||||||
|
const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::PLAYER_FORCED_MOVEMENT, -1);
|
||||||
|
if (id > -1 && !HasComponent(eReplicaComponentType::PLAYER_FORCED_MOVEMENT)) AddComponent<PlayerForcedMovementComponent>(id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case eReplicaComponentType::ROCKET_LANDING: {
|
case eReplicaComponentType::ROCKET_LANDING: {
|
||||||
// LWORocketAnimationControlComponent: the client makes it from the registry
|
// LWORocketAnimationControlComponent: the client makes it from the registry
|
||||||
const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::ROCKET_LANDING, -1);
|
const auto id = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::ROCKET_LANDING, -1);
|
||||||
@@ -1311,7 +1317,8 @@ namespace {
|
|||||||
using enum eReplicaComponentType;
|
using enum eReplicaComponentType;
|
||||||
return std::array{
|
return std::array{
|
||||||
POSSESSABLE, MODULE_ASSEMBLY, CONTROLLABLE_PHYSICS, SIMPLE_PHYSICS, RIGID_BODY_PHANTOM_PHYSICS, HAVOK_VEHICLE_PHYSICS,
|
POSSESSABLE, MODULE_ASSEMBLY, CONTROLLABLE_PHYSICS, SIMPLE_PHYSICS, RIGID_BODY_PHANTOM_PHYSICS, HAVOK_VEHICLE_PHYSICS,
|
||||||
PHANTOM_PHYSICS, SOUND_TRIGGER, RACING_SOUND_TRIGGER, BUFF, DESTROYABLE, COLLECTIBLE, PET, CHARACTER, INVENTORY,
|
PHANTOM_PHYSICS, SOUND_TRIGGER, RACING_SOUND_TRIGGER, BUFF, DESTROYABLE, COLLECTIBLE, PET, PLAYER_FORCED_MOVEMENT, CHARACTER,
|
||||||
|
INVENTORY,
|
||||||
SCRIPT, SKILL, BASE_COMBAT_AI, ITEM, QUICK_BUILD, MOVING_PLATFORM, SWITCH, VENDOR, DONATION_VENDOR, ACHIEVEMENT_VENDOR,
|
SCRIPT, SKILL, BASE_COMBAT_AI, ITEM, QUICK_BUILD, MOVING_PLATFORM, SWITCH, VENDOR, DONATION_VENDOR, ACHIEVEMENT_VENDOR,
|
||||||
BOUNCER, SCRIPTED_ACTIVITY, SHOOTING_GALLERY, RACING_CONTROL, LUP_EXHIBIT, MODEL, RENDER, MINI_GAME_CONTROL,
|
BOUNCER, SCRIPTED_ACTIVITY, SHOOTING_GALLERY, RACING_CONTROL, LUP_EXHIBIT, MODEL, RENDER, MINI_GAME_CONTROL,
|
||||||
};
|
};
|
||||||
@@ -1341,6 +1348,9 @@ void Entity::WriteComponents(RakNet::BitStream& outBitStream, eReplicaPacketType
|
|||||||
|
|
||||||
auto* const component = GetComponent(type);
|
auto* const component = GetComponent(type);
|
||||||
if (!component) continue;
|
if (!component) continue;
|
||||||
|
// A character writes its forced movement with its other parts (below); an object without one (the registry
|
||||||
|
// gives it, LOT 16684) writes it on its own, where the client reads it
|
||||||
|
if (type == PLAYER_FORCED_MOVEMENT && HasComponent(CHARACTER)) continue;
|
||||||
|
|
||||||
if (type == CHARACTER) {
|
if (type == CHARACTER) {
|
||||||
// Written with the character component; every character has them, a 0 bit stands in should one be missing
|
// Written with the character component; every character has them, a 0 bit stands in should one be missing
|
||||||
|
|||||||
Reference in New Issue
Block a user