Defent / DMS_Exile

DMS For Exile
Other
85 stars 108 forks source link

Fix Special Mission spawning and fix AI distance check #66

Closed PrimusNZ closed 6 years ago

PrimusNZ commented 6 years ago

Pull request fixes check for AI distance from missions.

Since the

_x setVariable ["DMS_LastAIDistanceCheck",time]

is occurring every loop of this code, then

if ((DMS_MaxAIDistance>0) && {!(_spawnPos isEqualTo 0)} && {((time - _lastDistanceCheckTime)>DMS_AIDistanceCheckFrequency) && {(_pos distance2D _spawnPos)>DMS_MaxAIDistance}}) then

will never be true, even when the AI are more than the max distance from the mission.

This Pull request fixes this by ensuring the check time is only updated when a check should occur.

Also added in https://github.com/Defent/DMS_Exile/issues/65 for sake of ease (Saving you from having to edit, commit, push etc)

eraser1 commented 6 years ago

Thanks for the catch.

As we discussed, I redid the TargetsKilled logic flow, so I'll have a new version out soon that fixes these issues (along with some other changes).