FOnline Development > General Discussion

Critter::WaitEndTick and Critter::PrevHexTick

(1/1)

k3tamina:
Do you know what are Critter::WaitEndTick and Critter::PrevHexTick?
Looks like the are undocumented

I'm trying to understand the InitWalkProcessing and Critter_IsRunning functions on 2238
Why call InitWalkProcessing on critter_init? Shouldn't be more logical to call it on start?

Wipe:
Critter::WaitEndTick saves tick when critter should be unblocked after performing action which shouldn't be overriden by next action in queue. or after "manually" calling Critter::Wait() in scripts.
Critter::PrevHexTick is set to time when moving Critter from one hex to another has started.

Atom:
InitWalkProcessing was a dirty walkaround to get the equivalent of GameOptions::GetTick() available in DLLs. This was done before GameOptions::GetTick() was added, for some trivial reasons.

InitWalkProcessing was called from critter_init so it could be processed soon after the server started and referred to the critter's "tick" fields to retrieve the time offset between FOnline's internal time counter and Windows' time counter. This made it possible to calculate on demand (what would be) the result of GameOptions::GetTick() in order to compare it with Critter::PrevHexTick, to determine whether the critter has recently moved.

Presently this method is obsolete and the whole thing can be replaced with GameOptions::GetTick() calls at the appropriate places.

Navigation

[0] Message Index

Go to full version