Jump to content

Game crashes when attacking a Volatile Canary on the ground with bare hands


Whateverr
  • Fixed

Here is an excerpt from the crash log:

[00:06:13]: [string "scripts/stategraphs/SGcanarypoisoned.lua"]:33: variable 'data' is not declared
LUA ERROR stack traceback:
    =[C]:-1 in (global) error (C) <-1--1>
    scripts/strict.lua:23 in () ? (Lua) <21-26>
    scripts/stategraphs/SGcanarypoisoned.lua:33 in (field) fn (Lua) <31-39>
    scripts/stategraph.lua:468 in (method) HandleEvent (Lua) <463-471>
    scripts/stategraph.lua:479 in (method) HandleEvents (Lua) <473-488>
    scripts/stategraph.lua:154 in (method) UpdateEvents (Lua) <148-157>
    scripts/stategraph.lua:145 in (method) Update (Lua) <109-146>
    scripts/update.lua:288 in () ? (Lua) <224-298>

It seems to be caused by an undeclared variable data on line 33 of the file stategraphs\SGcanarypoisoned.lua.

EventHandler("attacked", function(inst) --??? <--- Perhaps 'data' should be a parameter for this function
    if not inst.components.health:IsDead() then
        if CommonHandlers.TryElectrocuteOnAttacked(inst, data) then --!!! this is LINE 33 <--- 'data' is not declared
            return
        elseif not inst.sg:HasAnyStateTag("noattack", "nohit", "electrocute") then
            inst.sg:GoToState("hit")
        end
    end
end),

 


Steps to Reproduce
  1. Start a new world without any mods enabled.
  2. Execute c_spawn("canary_poisoned") to spawn a Volatile Canary on the ground.
  3. Attack the canary with your bare hands.

Note that the game will crash as long as your attack doesn't kill it in one hit.




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...