From 615823f024420339fec25cfa156acf611cf9b3e1 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 13 May 2020 16:17:40 -0700 Subject: [PATCH] player.ping for the ping in milliseconds of the player --- src/lua_playerlib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index d9766513..356cdd32 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -17,6 +17,7 @@ #include "d_player.h" #include "g_game.h" #include "p_local.h" +#include "d_clisrv.h" #include "lua_script.h" #include "lua_libs.h" @@ -385,6 +386,8 @@ static int player_get(lua_State *L) else if (fastcmp(field,"fovadd")) lua_pushfixed(L, plr->fovadd); #endif + else if (fastcmp(field,"ping")) + lua_pushinteger(L, playerpingtable[( plr - players )]); else { lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); I_Assert(lua_istable(L, -1));