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)
48
48
self .origSharpLength = self .SharpLength ;
49
49
50
50
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" );
53
54
self .maxAmmoCount = self .Magazine and self .Magazine .Capacity or 5 ; -- loading a game might mess this up, so... fall-back
54
55
55
56
self .delayedFire = false
@@ -71,7 +72,7 @@ function Create(self)
71
72
self .chamberDelay = 300 ;
72
73
end
73
74
74
- function Update (self )
75
+ function ThreadedUpdate (self )
75
76
self .chamberSound .Pos = self .Pos ;
76
77
self .preSound .Pos = self .Pos ;
77
78
@@ -283,4 +284,8 @@ function Update(self)
283
284
if self .InheritedRotAngleTarget > 0 then
284
285
self .InheritedRotAngleTarget = math.max (self .InheritedRotAngleTarget - TimerMan .DeltaTimeSecs , 0 );
285
286
end
287
+ end
288
+
289
+ function OnSave (self )
290
+ self :SetNumberValue (" ammoCounter" , self .ammoCounter );
286
291
end
You can’t perform that action at this time.
0 commit comments