Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with 5.3.0-dev due to strict type checking #553

Closed
VanessaE opened this issue May 7, 2020 · 3 comments
Closed

Does not work with 5.3.0-dev due to strict type checking #553

VanessaE opened this issue May 7, 2020 · 3 comments

Comments

@VanessaE
Copy link
Contributor

VanessaE commented May 7, 2020

Technic injects items into a pipeworks tube using strings for the item count. When this gets to Minetest's item entity code, it barfs because it requires a number, not a string.

Change the = "1" in register/common.lua line 77 to = 1 (that is, drop the quotation marks from around the value). Also, make this same change to other/injector.lua line 19.

There may be other similar errors, but these were the ones on my radar. This patch should fix them both:

diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua
index 193d051..c192614 100644
--- a/technic/machines/other/injector.lua
+++ b/technic/machines/other/injector.lua
@@ -16,7 +16,7 @@ local function inject_items (pos)
                                if stack then
                                local item0=stack:to_table()
                                if item0 then
-                                       item0["count"] = "1"
+                                       item0["count"] = 1
                                        technic.tube_inject_item(pos, pos, vector.new(0, -1, 0), item0)
                                        stack:take_item(1)
                                        inv:set_stack("main", i, stack)
diff --git a/technic/machines/register/common.lua b/technic/machines/register/common.lua
index 38354f9..9d88702 100644
--- a/technic/machines/register/common.lua
+++ b/technic/machines/register/common.lua
@@ -74,7 +74,7 @@ function technic.send_items(pos, x_velocity, z_velocity, output_name)
                if stack then
                        local item0 = stack:to_table()
                        if item0 then
-                               item0["count"] = "1"
+                               item0["count"] = 1
                                technic.tube_inject_item(pos, pos, vector.new(x_velocity, 0, z_velocity), item0)
                                stack:take_item(1)
                                inv:set_stack(output_name, i, stack)
BuckarooBanzay added a commit to mt-mods/technic that referenced this issue May 9, 2020
@VanessaE
Copy link
Contributor Author

Why is this still waiting to be fixed?

@SmallJoker
Copy link
Member

@VanessaE Because I barely check issues.

@SmallJoker
Copy link
Member

befe3ec

S-S-X pushed a commit to mt-mods/technic that referenced this issue Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants