mirror of
				https://github.com/DarkflameUniverse/DarkflameServer.git
				synced 2025-11-04 14:42:02 +00:00 
			
		
		
		
	fix path starting waypoint
This commit is contained in:
		@@ -48,7 +48,7 @@ MovementAIComponent::MovementAIComponent(Entity* parent, MovementAIInfo info) :
 | 
			
		||||
	m_TimeTravelled = 0;
 | 
			
		||||
	m_CurrentSpeed = 0;
 | 
			
		||||
	m_MaxSpeed = 0;
 | 
			
		||||
	m_StartingWaypointIndex = 0;
 | 
			
		||||
	m_StartingWaypointIndex = -1;
 | 
			
		||||
	m_CurrentPathWaypointIndex = 0;
 | 
			
		||||
	m_LockRotation = false;
 | 
			
		||||
	m_IsInReverse = false;
 | 
			
		||||
 
 | 
			
		||||
@@ -228,10 +228,6 @@ public:
 | 
			
		||||
	static float GetBaseSpeed(LOT lot);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
	// TODO: Advance properly
 | 
			
		||||
	void SetCurrentPathWaypointIndex(uint32_t value) {  };
 | 
			
		||||
	void SetNextPathWaypointIndex(uint32_t value) {  };
 | 
			
		||||
	float HandleWaypointCommandGroupEmote(const std::string& data);
 | 
			
		||||
	void HandleWaypointCommandSetVariable(const std::string& data);
 | 
			
		||||
	void HandleWaypointCommandCastSkill(const std::string& data);
 | 
			
		||||
 
 | 
			
		||||
@@ -83,8 +83,7 @@ void MovementAIComponent::HandleWaypointArrived(uint32_t commandIndex) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	m_Parent->AddCallbackTimer(delay, [this, commandIndex](){
 | 
			
		||||
		auto newCommandIndex = commandIndex + 1;
 | 
			
		||||
		this->HandleWaypointArrived(newCommandIndex);
 | 
			
		||||
		this->HandleWaypointArrived(commandIndex + 1);
 | 
			
		||||
		}
 | 
			
		||||
	);
 | 
			
		||||
}
 | 
			
		||||
@@ -205,10 +204,8 @@ void MovementAIComponent::HandleWaypointCommandChangeWaypoint(const std::string&
 | 
			
		||||
	} else path_string = data;
 | 
			
		||||
 | 
			
		||||
	if (path_string != "") {
 | 
			
		||||
		SetPathStartingWaypointIndex(index);
 | 
			
		||||
		SetupPath(path_string);
 | 
			
		||||
		// TODO: do better? talk to emo
 | 
			
		||||
		SetCurrentPathWaypointIndex(index);
 | 
			
		||||
		SetNextPathWaypointIndex(index);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user