Page MenuHomeFeedback Tracker

"isOverAiLimit" will always be false in SCR_AmbientPatrolManager
Awaiting internal Testing, NormalPublic

Description

On line 188 of SCR_AmbientPatrolManager you are checking if the current number of AI / maxChars is below GetAILimitThreshold()

However aiWorld.GetCurrentNumOfCharacters() and maxChars are both integers, so the result of dividing them is always zero (or rounded?), therefore it is always (or most of the time) going to return false

I think you need to cast them to floats first:

isAIOverLimit = ((float)aiWorld.GetCurrentNumOfCharacters() / (float)maxChars) > spawnpoint.GetAILimitThreshold();

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General

Event Timeline

Geez changed the task status from New to Awaiting internal Testing.Jul 25 2023, 11:34 AM