File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ private void NextExecute()
72
72
73
73
int sec = int . Parse ( timer . GetAttributeValue ( "value" , "0" ) ) ;
74
74
if ( sec < 0 ) sec = 0 ;
75
- ExecuteAt = DateTime . Now . AddSeconds ( sec * 2 ) ;
75
+ ExecuteAt = DateTime . Now . AddSeconds ( sec * 2 + Random . Shared . Next ( 20 , 40 ) ) ;
76
76
}
77
77
}
78
78
}
Original file line number Diff line number Diff line change @@ -151,10 +151,13 @@ private void UpdateHeroInfo()
151
151
var adventures = context . Adventures . Count ( x => x . AccountId == AccountId ) ;
152
152
if ( numberAdventure == 0 )
153
153
{
154
- var heroAdventures = context . Adventures . Where ( x => x . AccountId == AccountId ) . ToList ( ) ;
154
+ if ( adventures != 0 )
155
+ {
156
+ var heroAdventures = context . Adventures . Where ( x => x . AccountId == AccountId ) . ToList ( ) ;
155
157
156
- context . Adventures . RemoveRange ( heroAdventures ) ;
157
- context . SaveChanges ( ) ;
158
+ context . Adventures . RemoveRange ( heroAdventures ) ;
159
+ context . SaveChanges ( ) ;
160
+ }
158
161
}
159
162
else if ( adventures != numberAdventure )
160
163
{
You can’t perform that action at this time.
0 commit comments