wiremod / wire

Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.
http://www.wiremod.com
Apache License 2.0
547 stars 332 forks source link

Fix beingLookedAtByLocalPlayer #3046

Closed Denneisk closed 3 months ago

Denneisk commented 3 months ago
  1. Encapsulates serverside Initialize function in base entity in case that overrides the client one (this isn't related but it seems important regardless).
  2. Fix for beingLookAtByLocalPlayer by initializing it on its first call. Okay, hear me out: Pros:

    • No indirection after first call
    • No need to worry about execution order (As we have experienced before, BaseClass.BeingLookedAtByLocalPlayer is always defined by the time the draw function is called)

    Cons:

    • Will confuse the JIT for 1 frame

Fixes #3045