File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Data/Ronin.rte/Devices/Weapons/K98K Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,9 @@ function Create(self)
4848 self .origSharpLength = self .SharpLength ;
4949
5050 self .origReloadAngle = self .ReloadAngle
51-
52- self .ammoCounter = self .RoundInMagCount ;
51+
52+ self .ammoCounter = self :NumberValueExists (" ammoCounter" ) and self :GetNumberValue (" ammoCounter" ) or self .RoundInMagCount ;
53+ self :RemoveNumberValue (" ammoCounter" );
5354 self .maxAmmoCount = self .Magazine and self .Magazine .Capacity or 5 ; -- loading a game might mess this up, so... fall-back
5455
5556 self .delayedFire = false
@@ -71,7 +72,7 @@ function Create(self)
7172 self .chamberDelay = 300 ;
7273end
7374
74- function Update (self )
75+ function ThreadedUpdate (self )
7576 self .chamberSound .Pos = self .Pos ;
7677 self .preSound .Pos = self .Pos ;
7778
@@ -283,4 +284,8 @@ function Update(self)
283284 if self .InheritedRotAngleTarget > 0 then
284285 self .InheritedRotAngleTarget = math.max (self .InheritedRotAngleTarget - TimerMan .DeltaTimeSecs , 0 );
285286 end
287+ end
288+
289+ function OnSave (self )
290+ self :SetNumberValue (" ammoCounter" , self .ammoCounter );
286291end
You can’t perform that action at this time.
0 commit comments