Jump to content

else/end switched in scripts/prefabs/whip.lua


Hrafnar
  • Fixed

On line 59/61 in scripts/prefabs/whip.lua, the else/end statements are switched:

        if math.random() < chance then
            snap.Transform:SetScale(3, 3, 3)
            snap.SoundEmitter:PlaySound("dontstarve/common/whip_large")
            inst:DoTaskInTime(0, supercrack)
        end
            snap.SoundEmitter:PlaySound("dontstarve/common/whip_small")
        else

This should most likely read:

        if math.random() < chance then
            snap.Transform:SetScale(3, 3, 3)
            snap.SoundEmitter:PlaySound("dontstarve/common/whip_large")
            inst:DoTaskInTime(0, supercrack)
        else
            snap.SoundEmitter:PlaySound("dontstarve/common/whip_small")
        end

Diff:

--- a/scripts/prefabs/whip.lua
+++ b/scripts/prefabs/whip.lua
@@ -56,9 +56,9 @@ local function onattack(inst, attacker, target)
             snap.Transform:SetScale(3, 3, 3)
             snap.SoundEmitter:PlaySound("dontstarve/common/whip_large")
             inst:DoTaskInTime(0, supercrack)
-        end
-            snap.SoundEmitter:PlaySound("dontstarve/common/whip_small")
         else
+            snap.SoundEmitter:PlaySound("dontstarve/common/whip_small")
+        end
     end
 end

 


Steps to Reproduce
If you have good ears (untested): 1. Equip a whip 2. Hit something until you'll get a 'supercrack' 3. Notice that both sounds, whip_large and whip_small, are played Otherwise: 1. Open scripts/prefabs/whip.lua 2. Go to line 59 3. Notice that end/else should be else/end as dictated by logic and indentation



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


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

×
  • Create New...