From d04327c5e7d158358598a90389e255c44e7bfaed Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 12 Dec 2023 22:51:02 +1100 Subject: [PATCH] Expand /client blockedit to also allow editing sounds, try to fix crashing on PS3 --- readme.md | 2 +- src/Commands.c | 15 +++++++++++++++ src/Platform_PS3.c | 2 ++ src/Window_X11.c | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 97710bccf..0f408953c 100644 --- a/readme.md +++ b/readme.md @@ -32,7 +32,7 @@ If you're interested in documenting or verifying the behaviour of the original M * Works with effectively all graphics cards that support OpenGL or Direct3D 9 * Runs on Windows, macOS, Linux, Android, iOS, and in a web browser * Also runs on OpenBSD, FreeBSD, NetBSD, Solaris, Haiku, IRIX, SerenityOS -* Although still work in progresses, also runs on various consoles +* Although in various stages of early development, also runs on various consoles ### Instructions Initially, you will need to run ClassiCube.exe to download the required assets from minecraft.net and classicube.net.
diff --git a/src/Commands.c b/src/Commands.c index c5364586f..ba93e9583 100644 --- a/src/Commands.c +++ b/src/Commands.c @@ -566,6 +566,13 @@ static void BlockEditCommand_Execute(const cc_string* args, int argsCount__) { Chat_AddRaw("&a collide &e- Sets collision mode of the block"); Chat_AddRaw("&a drawmode &e- Sets draw mode of the block"); Chat_AddRaw("&a min/max &e- Sets min/max corner coordinates of the block"); + Chat_AddRaw("&eSee &a/client blockedit properties 2 &efor more properties"); + return; + } + if (String_CaselessEqualsConst(args, "properties 2")) { + Chat_AddRaw("&eEditable block properties (page 2):"); + Chat_AddRaw("&a walksound &e- Sets walk/step sound of the block"); + Chat_AddRaw("&a breaksound &e- Sets break sound of the block"); return; } @@ -636,6 +643,14 @@ static void BlockEditCommand_Execute(const cc_string* args, int argsCount__) { if (!BlockEditCommand_GetCoords(value, &coords)) return; Blocks.MaxBB[block] = coords; + } else if (String_CaselessEqualsConst(prop, "walksound")) { + if (!BlockEditCommand_GetInt(value, "Sound", &v, 0, SOUND_COUNT - 1)) return; + + Blocks.StepSounds[block] = v; + } else if (String_CaselessEqualsConst(prop, "breaksound")) { + if (!BlockEditCommand_GetInt(value, "Sound", &v, 0, SOUND_COUNT - 1)) return; + + Blocks.DigSounds[block] = v; } else { Chat_Add1("&eBlockEdit: &eUnknown property %s &e(See &a/client help blockedit&e)", prop); return; diff --git a/src/Platform_PS3.c b/src/Platform_PS3.c index b7f8f6556..0eb3c315f 100644 --- a/src/Platform_PS3.c +++ b/src/Platform_PS3.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "_PlatformConsole.h" const cc_result ReturnCode_FileShareViolation = 1000000000; // not used @@ -42,6 +43,7 @@ const cc_result ReturnCode_SocketInProgess = NET_EINPROGRESS; const cc_result ReturnCode_SocketWouldBlock = NET_EWOULDBLOCK; const char* Platform_AppNameSuffix = " PS3"; +SYS_PROCESS_PARAM(1001, 128 * 1024); // 128kb stack size /*########################################################################################################################* *------------------------------------------------------Logging/Time-------------------------------------------------------* diff --git a/src/Window_X11.c b/src/Window_X11.c index 27d597579..574ba1365 100644 --- a/src/Window_X11.c +++ b/src/Window_X11.c @@ -627,7 +627,7 @@ void Window_ProcessEvents(double delta) { case MappingNotify: if (e.xmapping.request == MappingModifier || e.xmapping.request == MappingKeyboard) { - Platform_LogConst("keybard mapping refreshed"); + Platform_LogConst("keyboard mapping refreshed"); XRefreshKeyboardMapping(&e.xmapping); } break;