From efd1d9004288b298c97561862bfb79da71033d46 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 20 Dec 2024 09:04:06 -0300 Subject: [PATCH] move: function to the correct place --- data/scripts/lib/register_monster_type.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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)