Skip to content

Is OperateTime updated properly? #1154

@shellohunter

Description

@shellohunter

if (OperateTime <= Envir.Time || time < OperateTime)
OperateTime = time;

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions