mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 16:55:27 +00:00
feat(entity): a model with behaviors gets no physics from the physics cases
As LWOControllablePhysComponent's and LWOPhantomPhysicsComponent's allocators do (like the simple physics one already): the registry's physics id is left to the model case, which makes the model's physics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -348,7 +348,10 @@ void Entity::DoObjectComponentLoad(ObjectLoadState& state) {
|
||||
}
|
||||
case eReplicaComponentType::CONTROLLABLE_PHYSICS: {
|
||||
const auto controllablePhysicsComponentID = state.GetComponentID(eReplicaComponentType::CONTROLLABLE_PHYSICS);
|
||||
if (controllablePhysicsComponentID > 0) {
|
||||
if (state.hasModelBehaviors) {
|
||||
// LWOControllablePhysComponent::Allocator (0x0104e070): left to the model case
|
||||
if (controllablePhysicsComponentID > 0) state.modelPhysicsComponentID = controllablePhysicsComponentID;
|
||||
} else if (controllablePhysicsComponentID > 0) {
|
||||
// The component places it: where the level put an object, where a character's save and the zone put it
|
||||
auto* controllablePhysics = AddComponent<ControllablePhysicsComponent>(controllablePhysicsComponentID);
|
||||
if (m_Character) controllablePhysics->LoadFromSaveData(m_Character->GetXMLDoc());
|
||||
@@ -388,7 +391,10 @@ void Entity::DoObjectComponentLoad(ObjectLoadState& state) {
|
||||
}
|
||||
case eReplicaComponentType::PHANTOM_PHYSICS: {
|
||||
const auto phantomPhysicsComponentID = state.GetComponentID(eReplicaComponentType::PHANTOM_PHYSICS);
|
||||
if (phantomPhysicsComponentID > 0 && !HasComponent(eReplicaComponentType::PHANTOM_PHYSICS)) {
|
||||
if (state.hasModelBehaviors) {
|
||||
// LWOPhantomPhysicsComponent::Allocator (0x010383b0): left to the model case
|
||||
if (phantomPhysicsComponentID > 0) state.modelPhysicsComponentID = phantomPhysicsComponentID;
|
||||
} else if (phantomPhysicsComponentID > 0 && !HasComponent(eReplicaComponentType::PHANTOM_PHYSICS)) {
|
||||
AddComponent<PhantomPhysicsComponent>(phantomPhysicsComponentID)->SetPhysicsEffectActive(false);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user