Mushroom mod bug...

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45
Location: France

Mushroom mod bug...

by redcrab » Thu Jan 19, 2012 21:14

I've got several crash due to mushroom mod lua error.
Code: Select all
20:33:18: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error: ...netest-Appliance/bin/../data/mods/mushrooms/init.lua:238: attempt to compare number with nil
20:33:18: ERROR[ServerThread]: stack traceback:

In thread b69ffb70:
Minetest-Appliance/src/server.cpp:115: virtual void* ServerThread::Thread(): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD b69ffb70:
#0  virtual void* ServerThread::Thread()
(Leftover data: #1  void Server::AsyncRunStep())
(Leftover data: #2  virtual void ServerEnvironment::step(float))
(Leftover data: #3  void RemoteClient::GetNextBlocks(Server*, float, irr::core::array<PrioritySortedBlockTransfer>&))
(Leftover data: #4  void BlockEmergeQueue::addBlock(irr::u16, v3s16, irr::u8))
DEBUG STACK FOR THREAD b750b6d0:
#0  int main(int, char**)
#1  void dedicated_server_loop(Server&, bool&)
(Leftover data: #2  irr::core::list<PlayerInfo> Server::getPlayerInfo())



So ... what's up ...
Last edited by redcrab on Thu Jan 19, 2012 22:32, edited 1 time in total.
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Thu Jan 19, 2012 22:48

My guess is that line 204: "local l_above = minetest.env:get_node_light({x = pos.x,y=pos.y+2,z=pos.z}, nil)" is returning nil because that pos wasn't generated or loaded from disk yet.

It should be noted that any of the minetest.env functions could return nil for unloaded mapblocks. For most mods you don't need to worry about it, but it is possible and should be checked for. Of course, I say that knowing I haven't.
Last edited by randomproof on Thu Jan 19, 2012 22:56, edited 1 time in total.
 

User avatar
Hackeridze
Member
 
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Fri Jan 20, 2012 09:33

randomproof wrote:My guess is that line 204: "local l_above = minetest.env:get_node_light({x = pos.x,y=pos.y+2,z=pos.z}, nil)" is returning nil because that pos wasn't generated or loaded from disk yet.

It should be noted that any of the minetest.env functions could return nil for unloaded mapblocks. For most mods you don't need to worry about it, but it is possible and should be checked for. Of course, I say that knowing I haven't.

Okay, I'm busy for now(a lot of work), but I will fix it in some weeks or apply the patch if somebody do that. Also problems about mod should be posted in %modname% thread.
My game: RTMG
GENTOO USER
 

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45
Location: France

by redcrab » Fri Jan 20, 2012 19:55

Hackeridze wrote:
randomproof wrote:My guess is that line 204: "local l_above = minetest.env:get_node_light({x = pos.x,y=pos.y+2,z=pos.z}, nil)" is returning nil because that pos wasn't generated or loaded from disk yet.

It should be noted that any of the minetest.env functions could return nil for unloaded mapblocks. For most mods you don't need to worry about it, but it is possible and should be checked for. Of course, I say that knowing I haven't.

Okay, I'm busy for now(a lot of work), but I will fix it in some weeks or apply the patch if somebody do that. Also problems about mod should be posted in %modname% thread.


I tried to fix it ... here my update into mushroom/init.lua file
just be sure to test for nil value .. line 220 and 238
Code: Select all
220c220
<                 elseif (l and l >= NEEDED_LIGHT)then
---
>                 elseif (l >= NEEDED_LIGHT)then
238c238
<                 elseif (l_above and l_above >= NEEDED_LIGHT)then
---
>                 elseif (l_above >= NEEDED_LIGHT)then


until know ... no crash ... wait and see :)
Last edited by redcrab on Fri Jan 20, 2012 19:56, edited 1 time in total.
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 2 guests