diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 3ed50e0b..6d605ad4 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -582,7 +582,6 @@ void D_RegisterServerCommands(void) */ void D_RegisterClientCommands(void) { - const char *username; INT32 i; for (i = 0; i < MAXSKINCOLORS; i++) @@ -639,8 +638,6 @@ void D_RegisterClientCommands(void) #endif // register these so it is saved to config - if ((username = I_GetUserName())) - cv_playername.defaultvalue = username; CV_RegisterVar(&cv_playername); CV_RegisterVar(&cv_playercolor); CV_RegisterVar(&cv_skin); // r_things.c (skin NAME) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 8d51bf3f..fc5ae657 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -465,11 +465,8 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) { // check if nodenum[1] is a space if (nodenum[1] == ' ') - { spc = 0; - free(nodenum); // don't need this anymore. // let it slide - } else { HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'.", false); @@ -664,7 +661,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) // run the lua hook even if we were supposed to eat the msg, netgame consistency goes first. #ifdef HAVE_BLUA - if (LUAh_PlayerMsg(playernum, target, flags, msg, spam_eatmsg)) + if (LUAh_PlayerMsg(playernum, target, flags, msg)) return; #endif @@ -989,11 +986,8 @@ static void HU_queueChatChar(char c) { // check if nodenum[1] is a space if (nodenum[1] == ' ') - { spc = 0; - free(nodenum); // let it slide - } else { HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'.", false); diff --git a/src/lua_hook.h b/src/lua_hook.h index 324babdb..252960ed 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -75,7 +75,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source); // Ho boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd); // Hook for B_BuildTiccmd boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_BuildTailsTiccmd by skin name boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors -boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute); // Hook for chat messages +boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer void LUAh_PlayerQuit(player_t *plr, int reason); // Hook for player quitting diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 697552ec..948eca84 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -952,10 +952,8 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector) return hooked; } -// Hook for player chat -// Added the "mute" field. It's set to true if the message was supposed to be eaten by spam protection. -// But for netgame consistency purposes, this hook is ran first reguardless, so this boolean allows for modders to adapt if they so desire. -boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute) + +boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg) { hook_p hookp; boolean hooked = false; @@ -984,19 +982,14 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute) LUA_PushUserdata(gL, &players[target-1], META_PLAYER); // target } lua_pushstring(gL, msg); // msg - if (mute) - lua_pushboolean(gL, true); // the message was supposed to be eaten by spamprotecc. - else - lua_pushboolean(gL, false); } lua_pushfstring(gL, FMT_HOOKID, hookp->id); lua_gettable(gL, LUA_REGISTRYINDEX); - lua_pushvalue(gL, -6); - lua_pushvalue(gL, -6); - lua_pushvalue(gL, -6); - lua_pushvalue(gL, -6); - lua_pushvalue(gL, -6); - if (lua_pcall(gL, 5, 1, 0)) { + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + if (lua_pcall(gL, 4, 1, 0)) { if (!hookp->error || cv_debug & DBG_LUA) CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); lua_pop(gL, 1); diff --git a/src/m_menu.c b/src/m_menu.c index 8f71c97a..ba9e08f3 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6346,7 +6346,10 @@ static void M_ConnectIP(INT32 choice) (void)choice; if (*setupm_ip == 0) + { + M_StartMessage("You must specify an IP address.\n", NULL, MM_NOTHING); return; + } COM_BufAddText(va("connect \"%s\"\n", setupm_ip));