Crystal
Crystal copied to clipboard
Is OperateTime updated properly?
https://github.com/Suprcode/Crystal/blob/c94eda0d2c10f4e64d35d4050ba4ee8ade0b4178/Server/MirObjects/MonsterObject.cs#L1308-L1309
got confused here. since it's updating Object's OperateTime, why the 2 if statements necessary?
plz correct me if I'm wrong:
OperateTime <= Envir.Timemeans if current OperateTime is expired. yes, obviously we need a new one.time < OperateTimemeans if new OperateTimetimeis ahead of the old one. that's to say, something must be taken care of ahead of time. yes, it's fine to update the operate time.
but what if current OperateTime is valid (OperateTime > Envir.Time), and we want to increase the delay (time > OpeateTime)?
imo, should be something like this:
if (time > Envir.Time || time != OperateTime)
OperateTime = time;