diff --git a/data/scripts/lib/register_monster_type.lua b/data/scripts/lib/register_monster_type.lua index da6403d1d67..81960f4f84d 100644 --- a/data/scripts/lib/register_monster_type.lua +++ b/data/scripts/lib/register_monster_type.lua @@ -17,6 +17,10 @@ end registerMonsterType.name = function(mtype, mask) if mask.name then mtype:name(mask.name) + -- Try register hazard monsters + mtype.onSpawn = function(monster, spawnPosition) + HazardMonster.onSpawn(monster, spawnPosition) + end end end registerMonsterType.description = function(mtype, mask) @@ -161,11 +165,6 @@ registerMonsterType.enemyFactions = function(mtype, mask) end end registerMonsterType.flags = function(mtype, mask) - -- Try register hazard monsters - mtype.onSpawn = function(monster, spawnPosition) - HazardMonster.onSpawn(monster, spawnPosition) - end - if mask.flags then if mask.flags.attackable ~= nil then mtype:isAttackable(mask.flags.attackable)