aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-07-08 21:02:42 +0200
committerkwolekr <kwolekr@minetest.net>2013-07-08 19:58:03 -0400
commitf419f66546b72ed265a5a4dc96569aeee8880d7a (patch)
tree9e7ec904ebb91fcee3ab27c656f9b1a7cf98dd4d /src
parentfca4610f11748814b41b068e14a875b4cdeb6bd4 (diff)
downloadminetest-f419f66546b72ed265a5a4dc96569aeee8880d7a.tar.gz
minetest-f419f66546b72ed265a5a4dc96569aeee8880d7a.tar.bz2
minetest-f419f66546b72ed265a5a4dc96569aeee8880d7a.zip
fix crash on play/start with empty world list
make enter button work in create world dialog
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 02bffa84d..580260ade 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1667,7 +1667,8 @@ int main(int argc, char *argv[])
}
// Set world path to selected one
- if(menudata.selected_world != -1){
+ if ((menudata.selected_world >= 0) &&
+ (menudata.selected_world < worldspecs.size())) {
worldspec = worldspecs[menudata.selected_world];
infostream<<"Selected world: "<<worldspec.name
<<" ["<<worldspec.path<<"]"<<std::endl;