Crystal icon indicating copy to clipboard operation
Crystal copied to clipboard

Is OperateTime updated properly?

Open shellohunter opened this issue 2 weeks ago • 0 comments

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.Time means if current OperateTime is expired. yes, obviously we need a new one.
  • time < OperateTime means if new OperateTime time is 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;

shellohunter avatar Dec 17 '25 00:12 shellohunter