Style fixes:
- the PROFILE call has a typo in the name
- the split line in
GetStaticsOnObstruction
has bad indentation (coming from copy-paste), see the other function and copy that indentation.
- remove the comment in
GetAllOnObstruction
- you didn't replace all occurrences in the public mod of
GetUnitCollisions
that you removed from the API
For me the big problem of this patch is this boolean passed to GetCollisions
which has an obfuscated name. It should be clear in the API what this boolean does (i.e. without having to understand the whole code in the Obstruction component).
I suggest calling the boolean onlyConstructionBlocking
(and probably making it optional, with a default value of true). Then comments should be detailed more in the function (explain in the first comment that living animals have the flag while dead ones are static obstructions without the flag). Add a remark that if the boolean is false, the filter filters nothing and is equivalent to NullObstructionFilter
.
Then I would add a comment in the Foundation.js code to explain that this code cleans everything under the foundation (corpses and other non foundation-blocking obstructions).