Added support for client-side Behaviors

This commit is contained in:
Boondorl 2025-07-08 02:52:17 -04:00 committed by Ricardo Luís Vaz Silva
commit a73d9f6e8f
5 changed files with 33 additions and 6 deletions

View file

@ -539,6 +539,8 @@ DBehavior* AActor::AddBehavior(PClass& type)
return nullptr;
b->Owner = this;
b->ObjectFlags |= (ObjectFlags & (OF_ClientSide | OF_Transient));
Behaviors[type.TypeName] = b;
Level->AddActorBehavior(*b);
IFOVERRIDENVIRTUALPTRNAME(b, NAME_Behavior, Initialize)
@ -653,6 +655,9 @@ void AActor::MoveBehaviors(AActor& from)
if (&from == this)
return;
if (IsClientside() != from.IsClientside())
I_Error("Cannot move Behaviors between client-side and world Actors");
// Clean these up properly before transferring.
ClearBehaviors();