Starchasers / OCGlasses

mod for minecraft and addon for Open Computers
zlib License
30 stars 17 forks source link

[Bug] addVertex function returns nil #81

Closed i3ym closed 4 years ago

i3ym commented 4 years ago

The wiki says that addVertex function should return vertex's index, but it returns nil

ben-mkiv commented 4 years ago

thanks for reporting the issue. do you have an example script which i can use to test my fix approach?

if you want to test yourself, heres the build: http://ci.pc-logix.com/job/OCGlasses/45/artifact/build/libs/OpenGlasses-MC1.12.2-2.2-45.jar

requires commons0815-1.3.5 which you can grab here: https://github.com/StarChasers/OCGlasses/raw/OG2-MC1.12.2/libs/Commons0815-1.12.2-1.3.5.jar

i3ym commented 4 years ago

Tested with the following code:

glasses = require("component").glasses;
tr = glasses.addCustom2D();
for i = 1, 20 do
  index = tr.addVertex(0, 0, 0);
  print(index);
end

Now works perfectly image