@@ -111,13 +111,12 @@ function ThreadedUpdate(self)
111111 self .needsChamber = false ;
112112 self .InheritedRotAngleTarget = 0 ;
113113 self .rotationSpeed = 0.1 ;
114-
115- local shell = CreateMOSParticle (" Casing Long" );
116114
117- shell .Pos = self .Pos ;
118- shell .Vel = self .Vel + Vector (- 6 * self .FlipFactor , - 4 ):RadRotate (self .RotAngle );
119- shell .Team = self .Team ;
120- MovableMan :AddParticle (shell );
115+ self .shell = CreateMOSParticle (" Casing Long" );
116+ self .shell .Pos = self .Pos ;
117+ self .shell .Vel = self .Vel + Vector (- 6 * self .FlipFactor , - 4 ):RadRotate (self .RotAngle );
118+ self .shell .Team = self .Team ;
119+ self :RequestSyncedUpdate ();
121120
122121 self .chamberAnim = true ;
123122 end
@@ -189,7 +188,12 @@ function ThreadedUpdate(self)
189188 end
190189
191190 if self .chamberAnim then
192- local balance = 5 + math.abs (math.sin (self .parent .RotAngle ) * 5 ); -- Laying down horizontally reduces swaying when pulling bolt
191+ local balance = 5 ;
192+
193+ if self .parent then
194+ balance = balance + math.abs (math.sin (self .parent .RotAngle ) * 5 ); -- Laying down horizontally reduces swaying when pulling bolt
195+ end
196+
193197 self .Frame = 1 ;
194198 self .SupportOffset = Vector (- 5 , - 1 );
195199 local rotTotal = math.sin (self .rotFactor )/ balance ;
@@ -286,6 +290,13 @@ function ThreadedUpdate(self)
286290 end
287291end
288292
293+ function SyncedUpdate (self )
294+ if self .shell then
295+ MovableMan :AddParticle (self .shell );
296+ self .shell = nil ;
297+ end
298+ end
299+
289300function OnSave (self )
290301 self :SetNumberValue (" ammoCounter" , self .ammoCounter );
291302end
0 commit comments