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

Mainmenu: Fix problems with recently added "game" type #5770

Merged
merged 1 commit into from May 19, 2017

Conversation

SmallJoker
Copy link
Member

Fixes problems pointed out in http://irc.minetest.ru/minetest-dev/2017-05-18#i_4927850
Caused by #5367

Copy link
Member

@nerzhul nerzhul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can make "string.find(mod.typ, "game")" a function with a good name could be nice

src/client.cpp Outdated
@@ -168,7 +168,7 @@ void Client::initMods()
if (!string_allowed(mod.name, MODNAME_ALLOWED_CHARS)) {
throw ModError("Error loading mod \"" + mod.name +
"\": Mod name does not follow naming conventions: "
"Only chararacters [a-z0-9_] are allowed.");
"Only characterss [a-z0-9_] are allowed.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@@ -252,7 +252,7 @@ function modmgr.render_modlist(render_list)
break
end
end
elseif v.typ == "game_mod" or v.typ == "game" then
elseif string.find(v.typ, "game") then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You really need find here and there? Prefer sub when it's possible.

@SmallJoker SmallJoker force-pushed the fix_mod_select branch 2 times, most recently from 39eafb4 to 6ae3424 Compare May 18, 2017 17:32
@SmallJoker
Copy link
Member Author

@nerzhul Instead of creating a function for this simple task, I extended the mod table to mark all the game content with the key/value is_game_content = true, which is IMO a better solution for this check.

@nerzhul nerzhul added this to the 0.4.16 milestone May 18, 2017
@nerzhul nerzhul merged commit 6744005 into minetest:master May 19, 2017
@SmallJoker SmallJoker deleted the fix_mod_select branch May 19, 2017 16:45
@nerzhul nerzhul added this to Done in Minetest 0.4.16 May 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants