Skip to content

Do not break script_reload command

Sergey Sylvian edited this page Nov 22, 2016 · 6 revisions

"script_reload" is a very useful console command that recompiles vscript files, like lua, during the middle of the game, meaning it stops you from having to restart the map just to test small LUA changes. But changes to code can break it, causing it to crash the game when used.

It has most recently been fixed in this PR https://github.com/darklordabc/Dota-2-Redux/pull/472

Wrong way

if modifier_npc_dota_hero_alchemist_perk == nil then modifier_npc_dota_hero_alchemist_perk = class({}) end

It causes crash for unknown reason. Maybe because we are trying to modify already linked modifier and then link it once again.

Correct way

modifier_npc_dota_hero_alchemist_perk = class({})