From a1500166be8bd038de3d653f43d67d67c361c4cb Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Wed, 20 Sep 2023 20:50:54 -0700 Subject: [PATCH] NSEntity: add method ::Relink() --- src/shared/NSEntity.h | 3 +++ src/shared/NSEntity.qc | 6 ++++++ src/shared/defs.h | 1 + 3 files changed, 10 insertions(+) diff --git a/src/shared/NSEntity.h b/src/shared/NSEntity.h index 5999010a..9e93643b 100644 --- a/src/shared/NSEntity.h +++ b/src/shared/NSEntity.h @@ -368,4 +368,7 @@ public: nonvirtual float GetSpawnTime(void); /** Move the entity to a new position, with updated angles. */ nonvirtual void Transport(vector, vector); + + /** Relink the entity against the world. Updates PVS info etc. */ + nonvirtual void Relink(void); }; \ No newline at end of file diff --git a/src/shared/NSEntity.qc b/src/shared/NSEntity.qc index e792d028..9ece12b5 100644 --- a/src/shared/NSEntity.qc +++ b/src/shared/NSEntity.qc @@ -979,4 +979,10 @@ NSEntity::Transport(vector new_pos, vector new_ang) if (flags & FL_CLIENT) Client_FixAngle(this, new_ang); #endif +} + +void +NSEntity::Relink(void) +{ + setorigin(this, origin); } \ No newline at end of file diff --git a/src/shared/defs.h b/src/shared/defs.h index 683d69bb..9bf14af5 100644 --- a/src/shared/defs.h +++ b/src/shared/defs.h @@ -48,6 +48,7 @@ callfunction(self.classname); \ } \ x ##_e.ReceiveEntity( y, readfloat() );\ + x ##_e.Relink();\ } #else