diff --git a/scripts/zones/The_Garden_of_RuHmet/mobs/Qnzdei.lua b/scripts/zones/The_Garden_of_RuHmet/mobs/Qnzdei.lua index 26a41839231..f67b38d396e 100644 --- a/scripts/zones/The_Garden_of_RuHmet/mobs/Qnzdei.lua +++ b/scripts/zones/The_Garden_of_RuHmet/mobs/Qnzdei.lua @@ -13,8 +13,8 @@ local changeState = function(mob, idle) mob:setLocalVar('idle', idle) -- Calculate door id based off of mob id and door offset - local doorID = ID.npc.QNZDEI_DOOR_OFFSET + (mob:getID() - ID.mob.QNZDEI_OFFSET) / 4 - local door = GetNPCByID(doorID) + local doorID = math.floor(ID.npc.QNZDEI_DOOR_OFFSET + (mob:getID() - ID.mob.QNZDEI_OFFSET) / 4) + local door = GetNPCByID(doorID) if door then local doorIdle = door:getLocalVar('idle') diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 8c092713878..b84625e5192 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -1896,12 +1896,11 @@ bool CLuaBaseEntity::pathThrough(sol::table const& pointsTable, sol::object cons bool CLuaBaseEntity::isFollowingPath() { - if (auto* PBattle = dynamic_cast(m_PBaseEntity)) + if (m_PBaseEntity->PAI && m_PBaseEntity->PAI->PathFind) { - return PBattle->PAI->PathFind != nullptr && PBattle->PAI->PathFind->IsFollowingPath(); + return m_PBaseEntity->PAI->PathFind->IsFollowingPath(); } - ShowError("Invalid entity type passed to function."); return false; }