Added support for client-side Behaviors
This commit is contained in:
parent
17f1c90d4a
commit
a73d9f6e8f
5 changed files with 33 additions and 6 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue