diff --git a/dGame/dComponents/MovementAIComponent.cpp b/dGame/dComponents/MovementAIComponent.cpp index 2cdf0987..e885b4bb 100644 --- a/dGame/dComponents/MovementAIComponent.cpp +++ b/dGame/dComponents/MovementAIComponent.cpp @@ -180,7 +180,7 @@ void MovementAIComponent::Update(const float deltaTime) { SetPath(waypoints); } else if (m_Path->pathBehavior == PathBehavior::Once) { // In this case we intended to follow a path and once we've followed it we camp there, otherwise we'd just wander home again. - m_BaseCombatAI->SetStartingPosition(m_SourcePosition); + if (m_BaseCombatAI) m_BaseCombatAI->SetStartingPosition(m_SourcePosition); Stop(); return; } @@ -459,7 +459,7 @@ void MovementAIComponent::RunWaypointCommands(uint32_t waypointNum) { if (inventoryComponent) { // items should always exist auto* const item = inventoryComponent->GetInventory(eInventoryType::ITEMS)->FindItemBySlot(0); - inventoryComponent->EquipItem(item); + if (item) inventoryComponent->EquipItem(item); } break; } @@ -468,19 +468,19 @@ void MovementAIComponent::RunWaypointCommands(uint32_t waypointNum) { if (inventoryComponent) { // items should always exist auto* const item = inventoryComponent->GetInventory(eInventoryType::ITEMS)->FindItemBySlot(0); - inventoryComponent->UnEquipItem(item); + if (item) inventoryComponent->UnEquipItem(item); } break; } - // case eWaypointCommandType::DELAY: { + case eWaypointCommandType::DELAY: { // Pause(GeneralUtils::TryParse(data).value_or(0.0f)); - // break; - // } + break; + } case eWaypointCommandType::EMOTE: { // m_Delay = RenderComponent::GetAnimationTime(m_Parent, data); // const auto emoteID = GeneralUtils::TryParse(data); // if (emoteID) GameMessages::SendPlayEmote(m_Parent->GetObjectID(), emoteID.value(), LWOOBJID_EMPTY, UNASSIGNED_SYSTEM_ADDRESS); - // break; + break; } case eWaypointCommandType::TELEPORT: break; case eWaypointCommandType::PATH_SPEED: m_BaseSpeed = GetBaseSpeed(m_Parent->GetLOT()) * GeneralUtils::TryParse(data).value_or(1.0f); break; diff --git a/dZoneManager/Zone.cpp b/dZoneManager/Zone.cpp index 6ebd5509..fcb755f0 100644 --- a/dZoneManager/Zone.cpp +++ b/dZoneManager/Zone.cpp @@ -104,7 +104,7 @@ void Zone::LoadZoneIntoMemory() { for (const Path& path : m_Paths) { if (path.pathType != PathType::Spawner) continue; SpawnerInfo info{}; - for (int i = 0; i < path.pathWaypoints.size(); i++) { + for (size_t i = 0; i < path.pathWaypoints.size(); i++) { const auto& waypoint = path.pathWaypoints[i]; SpawnerNode* node = new SpawnerNode(); node->position = waypoint.position;