mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-22 03:49:35 +08:00
在 item.EntityState == EntityState.Deleted 时直接移除物品
This commit is contained in:
parent
3a3477ca6e
commit
400fccbb26
@ -995,6 +995,10 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
{ "targets", targets.ToArray() }
|
{ "targets", targets.ToArray() }
|
||||||
};
|
};
|
||||||
bool result = item.UseItem(args);
|
bool result = item.UseItem(args);
|
||||||
|
if (item.EntityState == EntityState.Deleted)
|
||||||
|
{
|
||||||
|
user.Inventory.Items.Remove(item);
|
||||||
|
}
|
||||||
string key = args.Keys.FirstOrDefault(s => s.Equals("msg", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
string key = args.Keys.FirstOrDefault(s => s.Equals("msg", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||||
if (key != "" && args.TryGetValue(key, out object? value) && value is string str)
|
if (key != "" && args.TryGetValue(key, out object? value) && value is string str)
|
||||||
{
|
{
|
||||||
@ -1029,6 +1033,10 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
bool tempResult = item.UseItem(args);
|
bool tempResult = item.UseItem(args);
|
||||||
|
if (item.EntityState == EntityState.Deleted)
|
||||||
|
{
|
||||||
|
user.Inventory.Items.Remove(item);
|
||||||
|
}
|
||||||
string tempStr = "";
|
string tempStr = "";
|
||||||
string key = args.Keys.FirstOrDefault(s => s.Equals("msg", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
string key = args.Keys.FirstOrDefault(s => s.Equals("msg", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||||
if (key != "" && args.TryGetValue(key, out object? value) && value is string str)
|
if (key != "" && args.TryGetValue(key, out object? value) && value is string str)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user