diff --git a/src/console.c b/src/console.c index 8af560b36..f8fa1314a 100644 --- a/src/console.c +++ b/src/console.c @@ -613,15 +613,6 @@ void CON_Ticker(void) con_tick++; con_tick &= 7; - // if the menu is open then close the console. - if (menuactive && con_destlines) - { - consoletoggle = false; - con_destlines = 0; - CON_ClearHUD(); - I_UpdateMouseGrab(); - } - // console key was pushed if (consoletoggle) { @@ -793,7 +784,7 @@ boolean CON_Responder(event_t *ev) // check other keys only if console prompt is active if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!! { - if (bindtable[key]) + if (! menuactive && bindtable[key]) { COM_BufAddText(bindtable[key]); COM_BufAddText("\n"); diff --git a/src/d_main.c b/src/d_main.c index 9fcf349db..df4d71c3b 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -508,13 +508,11 @@ static void D_Display(void) // vid size change is now finished if it was on... vid.recalc = 0; - // FIXME: draw either console or menu, not the two - if (gamestate != GS_TIMEATTACK) - CON_Drawer(); - M_Drawer(); // menu is drawn even on top of everything // focus lost moved to M_Drawer + CON_Drawer(); + // // wipe update // diff --git a/src/hu_stuff.c b/src/hu_stuff.c index e3034c09c..9bca60208 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -759,6 +759,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) } else { +<<<<<<< HEAD UINT16 chatcolor = skincolors[players[playernum].skincolor].chatcolor; if (!chatcolor || chatcolor%0x1000 || chatcolor>V_INVERTMAP) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index efed9adb7..c29edbd61 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -142,6 +142,7 @@ static int lib_addHook(lua_State *L) case hook_HurtMsg: case hook_MobjMoveBlocked: case hook_MapThingSpawn: + case hook_FollowMobj: hook.s.mt = MT_NULL; if (lua_isnumber(L, 2)) hook.s.mt = lua_tonumber(L, 2); @@ -203,6 +204,7 @@ static int lib_addHook(lua_State *L) case hook_MobjRemoved: case hook_MobjMoveBlocked: case hook_MapThingSpawn: + case hook_FollowMobj: lastp = &mobjhooks[hook.s.mt]; break; case hook_JumpSpecial: @@ -210,7 +212,6 @@ static int lib_addHook(lua_State *L) case hook_SpinSpecial: case hook_JumpSpinSpecial: case hook_PlayerSpawn: - case hook_FollowMobj: case hook_PlayerCanDamage: case hook_TeamSwitch: case hook_ViewpointSwitch: @@ -1364,7 +1365,34 @@ boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj) lua_settop(gL, 0); - for (hookp = playerhooks; hookp; hookp = hookp->next) + // Look for all generic mobj follow item hooks + for (hookp = mobjhooks[MT_NULL]; hookp; hookp = hookp->next) + { + if (hookp->type != hook_FollowMobj) + continue; + + if (lua_gettop(gL) == 0) + { + LUA_PushUserdata(gL, player, META_PLAYER); + LUA_PushUserdata(gL, mobj, META_MOBJ); + } + lua_pushfstring(gL, FMT_HOOKID, hookp->id); + lua_gettable(gL, LUA_REGISTRYINDEX); + lua_pushvalue(gL, -3); + lua_pushvalue(gL, -3); + if (lua_pcall(gL, 2, 1, 0)) { + if (!hookp->error || cv_debug & DBG_LUA) + CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); + lua_pop(gL, 1); + hookp->error = true; + continue; + } + if (lua_toboolean(gL, -1)) + hooked = true; + lua_pop(gL, 1); + } + + for (hookp = mobjhooks[mobj->type]; hookp; hookp = hookp->next) { if (hookp->type != hook_FollowMobj) continue; diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 73bbe707b..1df08a446 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -97,6 +97,10 @@ static int player_get(lua_State *L) lua_pushboolean(L, true); else if (fastcmp(field,"name")) lua_pushstring(L, player_names[plr-players]); + else if (fastcmp(field,"realmo")) + LUA_PushUserdata(L, plr->mo, META_MOBJ); + // Kept for backward-compatibility + // Should be fixed to work like "realmo" later else if (fastcmp(field,"mo")) { if (plr->spectator) @@ -398,7 +402,7 @@ static int player_set(lua_State *L) if (hud_running) return luaL_error(L, "Do not alter player_t in HUD rendering code!"); - if (fastcmp(field,"mo")) { + if (fastcmp(field,"mo") || fastcmp(field,"realmo")) { mobj_t *newmo = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ)); plr->mo->player = NULL; // remove player pointer from old mobj (newmo->player = plr)->mo = newmo; // set player pointer for new mobj, and set new mobj as the player's mobj diff --git a/src/m_menu.c b/src/m_menu.c index ec3f59b41..2cdc87fc3 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3153,6 +3153,9 @@ boolean M_Responder(event_t *ev) if (gamestate == GS_TITLESCREEN && finalecount < TICRATE) return false; + if (CON_Ready()) + return false; + if (noFurtherInput) { // Ignore input after enter/escape/other buttons @@ -3512,6 +3515,7 @@ boolean M_Responder(event_t *ev) return false; default: + CON_Responder(ev); break; } diff --git a/src/mserv.c b/src/mserv.c index 505a21931..05a5344ba 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -18,7 +18,7 @@ #include -#if (defined (NOMD5) || defined (NOMSERV)) && !defined (NONET) +#if (defined (NOMSERV)) && !defined (NONET) #define NONET #endif diff --git a/src/p_mobj.c b/src/p_mobj.c index cc0620516..623f6692f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8001,8 +8001,9 @@ static void P_MobjSceneryThink(mobj_t *mobj) } if (mobj->fuse < 0) return; - if ((--mobj->fuse) < 6) + if (mobj->fuse < 6) mobj->frame = (mobj->frame & ~FF_TRANSMASK) | ((10 - (mobj->fuse*2)) << (FF_TRANSSHIFT)); + mobj->fuse--; } break; case MT_FINISHFLAG: @@ -11594,7 +11595,7 @@ void P_AfterPlayerSpawn(INT32 playernum) if (CheckForReverseGravity) P_CheckGravity(mobj, false); - + if (p->pflags & PF_FINISHED) P_GiveFinishFlags(p); } diff --git a/src/p_setup.c b/src/p_setup.c index 7b4c6773b..eee90e03d 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3096,7 +3096,7 @@ static void P_InitTagGametype(void) //Also, you'd never have to loop through all 32 players slots to find anything ever again. for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i] && !(players[i].spectator && players[i].quittime)) + if (playeringame[i] && !(players[i].spectator || players[i].quittime)) { playersactive[realnumplayers] = i; //stores the player's node in the array. realnumplayers++; diff --git a/src/p_user.c b/src/p_user.c index 6eac80238..d4ba864d4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -384,6 +384,9 @@ void P_GiveFinishFlags(player_t *player) if (!player->mo) return; + if (!(netgame||multiplayer)) + return; + for (i = 0; i < 3; i++) { angle_t fa = (angle >> ANGLETOFINESHIFT) & FINEMASK;