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

Replacer crash #392

Closed
thomasrudin opened this issue Dec 29, 2019 · 1 comment
Closed

Replacer crash #392

thomasrudin opened this issue Dec 29, 2019 · 1 comment

Comments

@thomasrudin
Copy link

Looks like an attempt to replace technic cables
https://github.com/pandorabox-io/technic/blob/pandorabox/technic/machines/register/cables.lua#L246

2019-12-29 13:19:03: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback item_OnPlace(): ...//worldmods/technic/technic/machines/register/cables.lua:246: attempt to concatenate local 'num' (a nil value)
2019-12-29 13:19:03: ERROR[Main]: stack traceback:
2019-12-29 13:19:03: ERROR[Main]: 	...//worldmods/technic/technic/machines/register/cables.lua:246: in function 'on_place'
2019-12-29 13:19:03: ERROR[Main]: 	/data/world//worldmods/replacer/init.lua:474: in function 'replace_single_node'
2019-12-29 13:19:03: ERROR[Main]: 	/data/world//worldmods/replacer/init.lua:548: in function </data/world//worldmods/replacer/init.lua:508>

@OgelGames
Copy link
Contributor

So it was me... 😄 (I tried to place cable plate with the replacer)

Turns out the crash was partly because of the replacer not passing a proper pointed_thing to on_place(): https://github.com/SwissalpS/replacer/blob/master/init.lua#L473 (above and under positions are the same), but also because there is no nil check or default value assigned to num: https://github.com/pandorabox-io/technic/blob/pandorabox/technic/machines/register/cables.lua#L218

I'm just going to add a nil check to the cables code, but it will mean that the replacer won't work correctly with the technic cable plates (due to the workaround to connected nodes not being rotatable); an additional fix to find a way for the replacer to pass a proper pointed_thing would be needed to make it work correctly.

OgelGames added a commit to mt-mods/technic that referenced this issue Dec 30, 2019
an additional fix is needed for the replacer to place cable plates correctly: pandorabox-io/pandorabox.io#392 (comment)
S-S-X pushed a commit to mt-mods/technic that referenced this issue Oct 20, 2021
an additional fix is needed for the replacer to place cable plates correctly: pandorabox-io/pandorabox.io#392 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants