[Fixed] Regression with actor dynamic light position fix (oops)

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Regression with actor dynamic light position fix (oops)

Postby Nash » Sat May 29, 2021 4:14 pm

After the fix committed 2 days ago, flashlight mods that use A_AttachLight behave weirdly: the light now flickers wildly as the player is moving around.

Example mod: Better Strife

Instructions: start the game and press F to turn on the flashlight. Move the player around.

Before fix commit, flashlight position is fine. After fix commit, flashlight is flickering while you move.

The script in question is simply this on an inventory item:

Code: Select allExpand view

    void SpawnFlashlight
(void)
    {
        Owner.A_AttachLight
        
(
            'BetterStrifePlayerFlashlightLight',
            DynamicLight.PointLight,
            Color(173, 204, 211),
            256.,
            0.,
            flags: DynamicLight.LF_ATTENUATE | DynamicLight.LF_DONTLIGHTSELF | DynamicLight.LF_SPOT,
            ofs:
            (
                0.0,
                7.85,
                PlayerPawn(Owner).ViewHeight
            
),
            spoti: 15.0,
            spoto: 25.0,
            // use some pitch outside of the -90 to 90 range to force it to use the attached actor's pitch
            spotp: 180.
        );
    }
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: Regression with actor dynamic light position fix (oops)

Postby drfrag » Sat May 29, 2021 5:50 pm

It's related to this one: viewtopic.php?f=57&t=72432
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: Regression with actor dynamic light position fix (oops)

Postby Graf Zahl » Mon May 31, 2021 2:14 pm

Working again. The idea was correct, but setting the position is a *bit* more complex than just copying a vector...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests