vrld / hump

LÖVE Helper Utilities for Massive Progression
http://hump.readthedocs.org
1.08k stars 153 forks source link

isvector breaks when two vectors are created from different vector instances #35

Closed karai17 closed 10 years ago

karai17 commented 10 years ago
local Vector = require "libs.hump.vector"
local Vec2 = require "libs.something_else.third_party.hump.vector"

local vertex1 = Vector(50, 50)
local vertex2 = Vec2(100, 100)

local sum = vertex1 + vertex2 -- crash!

I am using a library that has an internal instance of Vector, and I am needing to do some math with a local copy of Vector. The problem is, when isvector checks if they are both vectors (they are!), it decides that they aren't due to them coming from different instances of Vector.

Perhaps a fix for this would be to check the data structure's integrity instead of a pointer to the Vector library?

vrld commented 10 years ago

Fixed at last :)