vrld / HC

General purpose collision detection library for the use with LÖVE.
http://hc.readthedocs.org/
404 stars 48 forks source link

spatialhash.lua should require vector-light #48

Closed pablomayobre closed 6 years ago

pablomayobre commented 7 years ago

spatialhash.lua indexes the vector table 4 times yet it doesn't require vector-light.lua itself, so it is expecting it to be global which is a bad pattern.

The lines where vector is indexed are 149, 150 and 167

Fixing is as simple as adding the following line at the top of the file

local vector = require(_PACKAGE .. ".vector-light")
pablomayobre commented 6 years ago

This is no issue unless you use SpatialHash:intersectionsWithSegment which was added in PR #45.

This function uses all those 4 vector functions