Skip to content

Improved foolproof-ness

Latest
Compare
Choose a tag to compare
@Timmiej93 Timmiej93 released this 24 Feb 21:16
· 4 commits to master since this release
dc7bd0d

Overlapping (or close to each other) triggers will no longer create an issue like #1.

What was happening?

  1. Vehicle enters trigger 1. The vehicle's clip distance is set to the trigger defined (lower) clip distance, and the current (original) clip distance is stored.
  2. Vehicle enters trigger 2, while still inside trigger 1. The vehicle's clip distance is again set to that trigger's defined clip distance, and the current, already reduced by trigger 1, clip distance is stored.
  3. Vehicle leaves trigger 1, clip distance is reset to the original clip distance, which was stored in trigger 1.
  4. Vehicle leaves trigger 2, clip distance is reset to the reduced clip distance, which was stored by trigger 2.

If the vehicle would leave trigger 2 first, and then trigger 1, the clip distance would be reset properly.

How has this been fixed?

Instead of storing clip distances in each trigger (completely independent, triggers don't know of each other's data), data is now stored in a global database as well, that each trigger can access. Data is also still stored locally, for optimization.
By storing the data in this global database, a vehicle's clip distance will only be stored if no other trigger has already stored a clip distance. This will ensure that only the clip distance of vehicles that enter a trigger with their original clip distance active will be stored.