Skip to content

Instantly share code, notes, and snippets.

kahrl

Block or report user

Report or block kahrl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:985726
public static String initCap(String s) {
StringBuffer result = new StringBuffer(s.length());
boolean upper = true;
for (int i = 0; i < s.length(); ++i) {
char c = s.charAt(i);
if (Character.isWhitespace(c)) {
upper = true;
} else if (upper) {
c = Character.toUpperCase(c);
upper = false;
View gist:5569240
diff --git a/minetest.conf.example b/minetest.conf.example
index 36ef314..7d56f99 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -151,6 +151,8 @@
#crosshair_color = (255,255,255)
# Cross alpha (opaqueness, between 0 and 255)
#crosshair_alpha = 255
+# Sensitivity multiplier
+#mouse_sensitivity = 0.2
View gist:5608391
diff --git a/src/emerge.cpp b/src/emerge.cpp
index 2d8b018..b31a942 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -349,7 +349,7 @@ bool EmergeThread::getBlockOrStartGen(v3s16 p, MapBlock **b,
void *EmergeThread::Thread() {
ThreadStarted();
- log_register_thread("EmergeThread" + id);
+ log_register_thread("EmergeThread" + itos(id));
View gist:5619535
diff --git a/src/mods.cpp b/src/mods.cpp
index 9097f57..9bcf73a 100644
--- a/src/mods.cpp
+++ b/src/mods.cpp
@@ -309,7 +309,7 @@ void ModConfiguration::addMods(std::vector<ModSpec> new_mods)
// BAD CASE: name conflict in different levels.
u32 oldindex = existing_mods[mod.name];
const ModSpec &oldmod = m_unsatisfied_mods[oldindex];
- errorstream<<"WARNING: Mod name conflict detected: \""
+ actionstream<<"WARNING: Mod name conflict detected: \""
View gist:5646751
diff --git a/src/main.cpp b/src/main.cpp
index eda9927..42fa45b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -79,6 +79,8 @@
#include "sound.h"
#include "sound_openal.h"
+TimeTaker *g_mainmenutimetaker;
+
View gist:5646805
diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp
index 8abee4d..1719e73 100644
--- a/src/guiEngine.cpp
+++ b/src/guiEngine.cpp
@@ -182,6 +182,7 @@ void TextDestGuiEngine::gotText(std::wstring text)
}
}
+ dstream<<"Main menu took "<<g_mainmenutimetaker->getTimerTime()<<"ms to initialize"<<std::endl;
run();
View gist:5684778
diff --git a/src/filesys.cpp b/src/filesys.cpp
index 06b0e48..21f9f88 100644
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -146,6 +146,11 @@ bool IsDir(std::string path)
(attr & FILE_ATTRIBUTE_DIRECTORY));
}
+bool IsDirDelimiter(char c)
+{
View gist:5685589
diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua
index 808c165..ddf500a 100644
--- a/builtin/mainmenu.lua
+++ b/builtin/mainmenu.lua
@@ -554,7 +554,7 @@ function tabbuilder.handle_delete_world_buttons(fields)
if fields["world_delete_confirm"] then
if menu.last_world > 0 and
- menu.last_world < #menu.worldlist then
+ menu.last_world <= #menu.worldlist then
View gist:5688237
diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua
index 808c165..ddf500a 100644
--- a/builtin/mainmenu.lua
+++ b/builtin/mainmenu.lua
@@ -554,7 +554,7 @@ function tabbuilder.handle_delete_world_buttons(fields)
if fields["world_delete_confirm"] then
if menu.last_world > 0 and
- menu.last_world < #menu.worldlist then
+ menu.last_world <= #menu.worldlist then
View gist:5688612
diff --git a/src/game.cpp b/src/game.cpp
index ffc69d7..0118ae3 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -66,6 +66,7 @@
#include "sound_openal.h"
#endif
#include "event_manager.h"
+#include <iomanip>
#include <list>
You can’t perform that action at this time.