DrVrej / VJ-Base

An addon for Garry's mod that contains bunch of bases to make many different types of addons.

Home Page:http://steamcommunity.com/sharedfiles/filedetails/?id=131759821

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverside lua error

wrefgtzweve opened this issue · comments

commented

We've been getting this serverside Lua error pretty frequently, doesn't seem like a big issue but it's been going on for a while so i might as well report it. I do not know how to replicate it.

[ERROR] lua/vj_base/npc_schedules.lua:155: attempt to call method 'VJ_TASK_IDLE_STAND' (a nil value)
  1. RunCode_OnFail - lua/entities/npc_vj_creature_base/init.lua:1451
    2. DoRunCode_OnFail - lua/vj_base/npc_schedules.lua:143
      3.  - lua/vj_base/npc_schedules.lua:155
commented

This bug has been present for a while, it's harmless. Basically Lua is failing to recognize the function at random instances. I have found no way of replicating this, making it extremely difficult to fix (if even possible).

commented

It's only being set when doLOSChase is false, otherwise it's being skipped (i think)
image

commented

if self:DoRunCode_OnFail(curSchedule) == true then

Could be simplified to make sure the error doesn't happen anymore
image

commented

Setting that there won't change anything, the issue is that Lua thinks self:VJ_TASK_IDLE_STAND() is nil, a check like this could possibly solve it:

task_chaseEnemy.RunCode_OnFail = function() if self.VJ_TASK_IDLE_STAND then self:VJ_TASK_IDLE_STAND() end end

But this is an ugly solution

commented

Added fail safe in d9881b0, hopefully this will fix it