bug in aeColliding function in AE
Posted: Wed Jul 17, 2013 2:37 pm
Hello
after many tests, j found a bug in the "aeCollidingObjects()"
this is the current code of this function
----------------
function aeCollidingObjects
local tObjects,tReturn
repeat for each key theKey in aeCollisionListener
repeat for each line theLine in aeCollisionListener[theKey]
if intersect(theKey,theLine,"pixels") then
put theLine&cr after tObjects
end if
end repeat
delete char -1 of tObjects
put tObjects into tReturn[theKey]
if tReturn[theKey] is empty then delete variable tReturn[theKey]
end repeat
return tReturn
end aeCollidingObjects
--------------
if you look at the local variable tObjects, you can see that this variable is not initialized for each loop of the first repeat ("repeat for each key theKey in aeCollisionListener") and then
if you are watching for 2 objects, if the first one has a collision, it is written in the tObjects but after if the second object has no collision, normally, tObjects would be empty but it wrong because it is not initialize and keep the value from the first object ....
Then if it is possible to have a correction for that thanks because J need to use AE (and I have paid it)
Fm31
after many tests, j found a bug in the "aeCollidingObjects()"
this is the current code of this function
----------------
function aeCollidingObjects
local tObjects,tReturn
repeat for each key theKey in aeCollisionListener
repeat for each line theLine in aeCollisionListener[theKey]
if intersect(theKey,theLine,"pixels") then
put theLine&cr after tObjects
end if
end repeat
delete char -1 of tObjects
put tObjects into tReturn[theKey]
if tReturn[theKey] is empty then delete variable tReturn[theKey]
end repeat
return tReturn
end aeCollidingObjects
--------------
if you look at the local variable tObjects, you can see that this variable is not initialized for each loop of the first repeat ("repeat for each key theKey in aeCollisionListener") and then
if you are watching for 2 objects, if the first one has a collision, it is written in the tObjects but after if the second object has no collision, normally, tObjects would be empty but it wrong because it is not initialize and keep the value from the first object ....
Then if it is possible to have a correction for that thanks because J need to use AE (and I have paid it)
Fm31