[Quest API] Expand SaveGuardSpot (#2258)

* Expand SaveGuardSpot

- Adds
-- mob:saveguardspot()
-- mob:saveguardspot(true)

* Perl Support
Thanks to KinglyKrab for the perl implementation.
This commit is contained in:
Michael
2022-06-10 13:52:22 -04:00
committed by GitHub
parent 83e066bffc
commit e75f87a535
5 changed files with 49 additions and 9 deletions
+14
View File
@@ -557,6 +557,20 @@ void NPC::SetWaypointPause()
}
}
void NPC::SaveGuardSpot(bool ClearGuardSpot) {
if (ClearGuardSpot) {
LogAI("Clearing guard order.");
m_GuardPoint = glm::vec4();
} else {
m_GuardPoint = m_Position;
if (m_GuardPoint.w == 0) {
m_GuardPoint.w = 0.0001; //hack to make IsGuarding simpler
}
LogAI("Setting guard position to {0}", to_string(static_cast<glm::vec3>(m_GuardPoint)));
}
}
void NPC::SaveGuardSpot(const glm::vec4 &pos)
{
m_GuardPoint = pos;