Sign in to follow this  

Fireflies can be bugnetted at any time


CarlZalph
  • Pending

There are no checks to see if a client is trying to bugnet a firefly even during the day time when it shouldn't be possible to do so.

 

Error lies within not disabling the workable component when the flies shouldn't be able to be netted.

scripts/prefabs/fireflies.lua: updatefade & fadein functions

Current faulty code bits:

        if inst._fadeval:value() <= 0 and TheWorld.ismastersim then
            inst:AddTag("NOCLICK")
            inst.Light:Enable(false)
        end
.
        if ismastersim then
            inst:RemoveTag("NOCLICK")
            inst.Light:Enable(true)
            inst.AnimState:PlayAnimation("swarm_pre")
            inst.AnimState:PushAnimation("swarm_loop", true)
            inst._faderate:set(randomizefadein())
        end

Fixed:

        if inst._fadeval:value() <= 0 and TheWorld.ismastersim then
            inst:AddTag("NOCLICK")
            inst.components.workable:SetWorkable(false)
            inst.Light:Enable(false)
        end
.
        if ismastersim then
            inst:RemoveTag("NOCLICK")
            inst.components.workable:SetWorkable(true)
            inst.Light:Enable(true)
            inst.AnimState:PlayAnimation("swarm_pre")
            inst.AnimState:PushAnimation("swarm_loop", true)
            inst._faderate:set(randomizefadein())
        end

Note that I'm not checking if the workable component still exists on this prefab as this prefab already makes that assumption in its ondropped function.

Ideally it would verify that the prefab itself still has the component before trying to use it in case a mod removes it, but it is what it is.


Steps to Reproduce
Use a modified client script to make fireflies visible and clickable on demand to easily send the bugnet RPC to catch them. Alternatively use a radius entity grab and send an RPC on the firefly within the radius.
Sign in to follow this  


User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now