mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-15 16:34:40 +01:00
Fix inventory system crash
Forgot to assign position value
This commit is contained in:
@@ -137,7 +137,7 @@ namespace nksrv.Utils
|
||||
}
|
||||
public class CoreInfo
|
||||
{
|
||||
public int DbVersion = 0;
|
||||
public int DbVersion = 2;
|
||||
public List<User> Users = [];
|
||||
|
||||
public List<AccessToken> LauncherAccessTokens = [];
|
||||
@@ -187,6 +187,20 @@ namespace nksrv.Utils
|
||||
}
|
||||
Console.WriteLine("Database update completed");
|
||||
}
|
||||
else if (Instance.DbVersion == 1)
|
||||
{
|
||||
Console.WriteLine("Starting database update...");
|
||||
// there was a bug where equipment position was not saved, so remove all items from each characters
|
||||
Instance.DbVersion = 2;
|
||||
foreach (var user in Instance.Users)
|
||||
{
|
||||
foreach (var f in user.Items.ToList())
|
||||
{
|
||||
f.Csn = 0;
|
||||
}
|
||||
}
|
||||
Console.WriteLine("Database update completed");
|
||||
}
|
||||
Save();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user