Make ClientInterface::statenames consistent with the state enum again
authorest31 <MTest31@outlook.com>
Mon, 31 Aug 2015 11:26:40 +0000 (13:26 +0200)
committerest31 <MTest31@outlook.com>
Mon, 31 Aug 2015 11:31:29 +0000 (13:31 +0200)
Fixes minetest.get_player_information segfault due
to out of bounds access problems, when compiled as debug build.

src/clientiface.cpp
src/clientiface.h

index d4efe60ef50451bbbf4438bc1564bea47d783893..a6ab1ef41ceb4487d86277bfbbc8b6b89fb22dca 100644 (file)
@@ -38,10 +38,12 @@ const char *ClientInterface::statenames[] = {
        "Disconnecting",
        "Denied",
        "Created",
-       "InitSent",
+       "AwaitingInit2",
+       "HelloSent",
        "InitDone",
        "DefinitionsSent",
-       "Active"
+       "Active",
+       "SudoMode",
 };
 
 
index 9be8bda617a652e2543440782af9fbe47023b10b..0d2bca1965ce535ce3bed7fb63fe2c2c51e7dbdc 100644 (file)
@@ -167,6 +167,9 @@ namespace con {
 
 #define CI_ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))
 
+// Also make sure to update the ClientInterface::statenames
+// array when modifying these enums
+
 enum ClientState
 {
        CS_Invalid,