opendarkeden / server

38 stars 30 forks source link

fix lua init code for the previous commit #94

Closed tiancaiamao closed 1 year ago

tiancaiamao commented 1 year ago

close https://github.com/opendarkeden/server/issues/93

The last commit introduce some bug, the server can't start up.

After upgrade lua4.X to 5.1, the API changes, those are not needed any more:

    // baselibopen();
    // mathlibopen();
    // strlibopen();
    // iolibopen();

Just call

    luaL_openlibs(m_pState);

See also https://stackoverflow.com/questions/12017980/lua-errorpanic-unprotected-error-in-call-to-lua-api-attempt-to-call-a-nil-valu

tiancaiamao commented 1 year ago

I'm not sure all the quest related functionality works ... it's not battle tested.