alaestor / Rimworld-Teleporting

1 stars 1 forks source link

Using console immediately after cooldown causes job to end before targeting starts #26

Closed alaestor closed 3 years ago

alaestor commented 3 years ago

use local teleport, immediately use console again, pawn goes to console, nothing happens, pawn job ends

alaestor commented 3 years ago

The bug occurred because teleporting the pawn that was controlling the console interrupted the job toil which stopped the toil from checking IsToilDone() until teleporting was attempted again.

The bugfix now checks for these jobs before despawning the pawn; if the current job indicates that the pawn is teleporting itself with the console, it will end the job toil and call the console.IsDoneTargeting() for any applicable cleanup (at the time of writing: setting hasStartedTargetting to false)