Skip to content

Commit

Permalink
Merge pull request #6651 from LandSandBoat/tiny_fixes
Browse files Browse the repository at this point in the history
Misc: Tiny fixes (binding restrictions and numeric truncation)
  • Loading branch information
zach2good authored Jan 4, 2025
2 parents 63e11b5 + 6f97412 commit 0924f3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/zones/The_Garden_of_RuHmet/mobs/Qnzdei.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
5 changes: 2 additions & 3 deletions src/map/lua/lua_baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1896,12 +1896,11 @@ bool CLuaBaseEntity::pathThrough(sol::table const& pointsTable, sol::object cons

bool CLuaBaseEntity::isFollowingPath()
{
if (auto* PBattle = dynamic_cast<CBattleEntity*>(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;
}

Expand Down

0 comments on commit 0924f3f

Please sign in to comment.