CC: Tweaked

CC: Tweaked

57M Downloads

Incorrectly written if/else if in ComputerThread?

Opened this issue ยท 1 comments

commented

Minecraft: 1.14.4
CC:T: 93a9ebc

Not a bug report per se; just found something sketchy in the code.

https://github.com/SquidDev-CC/CC-Tweaked/blob/mc-1.14.x/src/main/java/dan200/computercraft/core/computer/ComputerThread.java#L398

The else if clause here can never run because if afterHardAbort is >= ABORT_TIMEOUT * 2 then it must be >= ABORT_TIMEOUT, so the first if clause will always run, even if afterHardAbort is >= ABORT_TIMEOUT * 2.

commented

Yeah, that looks stupid. Wonder how that slipped through.