|
@@ -438,15 +438,15 @@ function HandleCrowdAgentReposition(eventType, eventData)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
function HandleCrowdAgentFormation(eventType, eventData)
|
|
function HandleCrowdAgentFormation(eventType, eventData)
|
|
|
- local index = eventData:GetUInt("Index")
|
|
|
|
|
- local size = eventData:GetUInt("Size")
|
|
|
|
|
- local position = eventData:GetVector3("Position")
|
|
|
|
|
|
|
+ local index = eventData["Index"]:GetUInt()
|
|
|
|
|
+ local size = eventData["Size"]:GetUInt()
|
|
|
|
|
+ local position = eventData["Position"]:GetVector3()
|
|
|
|
|
|
|
|
-- The first agent will always move to the exact position, all other agents will select a random point nearby
|
|
-- The first agent will always move to the exact position, all other agents will select a random point nearby
|
|
|
if index > 0 then
|
|
if index > 0 then
|
|
|
local crowdManager = GetEventSender()
|
|
local crowdManager = GetEventSender()
|
|
|
- local agent = eventData:GetPtr("CrowdAgent", "CrowdAgent")
|
|
|
|
|
- eventData:SetVector3("Position", crowdManager:GetRandomPointInCircle(position, agent.radius, agent.queryFilterType))
|
|
|
|
|
|
|
+ local agent = eventData["CrowdAgent"]:GetPtr("CrowdAgent")
|
|
|
|
|
+ eventData["Position"] = crowdManager:GetRandomPointInCircle(position, agent.radius, agent.queryFilterType)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|