加强对投喂的检查 by牢C

This commit is contained in:
ZouJin
2024-03-22 20:17:40 +08:00
parent a7e817776d
commit 9b8c2f31fb
2 changed files with 4 additions and 2 deletions

View File

@ -192,7 +192,8 @@ namespace VPet_Simulator.Windows
//看是什么模式
bool EnableFunction = mf.mw.Set.EnableFunction && mf.mw.HashCheck && !item.IsOverLoad()
&& item.Price >= 1 && item.Price <= 1000 && item.Health >= 0 && item.Exp >= 0 &&
item.Likability >= 0 && item.Price + 1000 < mf.mw.GameSavesData.GameSave.Money;
item.Likability >= 0 && item.Price + 1000 < mf.mw.GameSavesData.GameSave.Money &&
item.Strength >= 0 && item.StrengthDrink >= 0 && item.StrengthFood >= 0 && item.Feeling >= 0;
//不吃负面/太贵/太便宜
if (EnableFunction)//扣钱

View File

@ -387,7 +387,8 @@ public partial class winMutiPlayer : Window, IMPWindows
mw.Main.LabelDisplayShow("{0}花费${3}给{1}买了{2}".Translate(byname, mw.GameSavesData.GameSave.Name, feed.Item.TranslateName, feed.Item.Price), 10000);
Log("{0}花费${3}给{1}买了{2}".Translate(byname, mw.GameSavesData.GameSave.Name, feed.Item.TranslateName, feed.Item.Price));
//对于要修改数据的物品一定要再次检查,避免联机开挂毁存档
if (item.Price >= 10 && item.Price <= 1000 && item.Health >= 0 && item.Exp >= 0 && item.Likability >= 0 && giveprice < 1000)
if (item.Price >= 10 && item.Price <= 1000 && item.Health >= 0 && item.Exp >= 0 && item.Likability >= 0 && giveprice < 1000
&& item.Strength >= 0 && item.StrengthDrink >= 0 && item.StrengthFood >= 0 && item.Feeling >= 0)
{//单次联机收礼物上限1000
giveprice += item.Price;
mw.TakeItem(feed.Item);