Jump to content

[11038][Patch] Small crash-fix in commands handling


Feanordev

Recommended Posts

If you give no arguments for setmovetype command it will crash:

diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index dd14161..c80fed8 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -1966,6 +1966,9 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(char* args)

    MovementGeneratorType move_type;
    char* type_str = ExtractLiteralArg(&args);
+    if (!type_str)
+        return false;
+
    if (strncmp(type_str, "stay", strlen(type_str)) == 0)
        move_type = IDLE_MOTION_TYPE;
    else if (strncmp(type_str, "random", strlen(type_str)) == 0)

Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use