commit
d1105abdb3
|
@ -745,9 +745,12 @@ void Got_Filetxpak(void)
|
||||||
{
|
{
|
||||||
INT32 filenum = netbuffer->u.filetxpak.fileid;
|
INT32 filenum = netbuffer->u.filetxpak.fileid;
|
||||||
fileneeded_t *file = &fileneeded[filenum];
|
fileneeded_t *file = &fileneeded[filenum];
|
||||||
char *filename = file->filename;
|
char *filename;
|
||||||
static INT32 filetime = 0;
|
static INT32 filetime = 0;
|
||||||
|
|
||||||
|
filename = va("%s", file->filename);
|
||||||
|
nameonly(filename);
|
||||||
|
|
||||||
if (!(strcmp(filename, "srb2.pk3")
|
if (!(strcmp(filename, "srb2.pk3")
|
||||||
&& strcmp(filename, "srb2.srb")
|
&& strcmp(filename, "srb2.srb")
|
||||||
&& strcmp(filename, "srb2.wad")
|
&& strcmp(filename, "srb2.wad")
|
||||||
|
@ -758,6 +761,8 @@ void Got_Filetxpak(void)
|
||||||
))
|
))
|
||||||
I_Error("Tried to download \"%s\"", filename);
|
I_Error("Tried to download \"%s\"", filename);
|
||||||
|
|
||||||
|
filename = file->filename;
|
||||||
|
|
||||||
if (filenum >= fileneedednum)
|
if (filenum >= fileneedednum)
|
||||||
{
|
{
|
||||||
DEBFILE(va("fileframent not needed %d>%d\n", filenum, fileneedednum));
|
DEBFILE(va("fileframent not needed %d>%d\n", filenum, fileneedednum));
|
||||||
|
|
|
@ -308,6 +308,8 @@ static int lib_cvRegisterVar(lua_State *L)
|
||||||
#define FIELDERROR(f, e) luaL_error(L, "bad value for " LUA_QL(f) " in table passed to " LUA_QL("CV_RegisterVar") " (%s)", e);
|
#define FIELDERROR(f, e) luaL_error(L, "bad value for " LUA_QL(f) " in table passed to " LUA_QL("CV_RegisterVar") " (%s)", e);
|
||||||
#define TYPEERROR(f, t) FIELDERROR(f, va("%s expected, got %s", lua_typename(L, t), luaL_typename(L, -1)))
|
#define TYPEERROR(f, t) FIELDERROR(f, va("%s expected, got %s", lua_typename(L, t), luaL_typename(L, -1)))
|
||||||
|
|
||||||
|
memset(cvar, 0x00, sizeof(consvar_t)); // zero everything by default
|
||||||
|
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
while (lua_next(L, 1)) {
|
while (lua_next(L, 1)) {
|
||||||
// stack: cvar table, cvar userdata, key/index, value
|
// stack: cvar table, cvar userdata, key/index, value
|
||||||
|
@ -395,6 +397,13 @@ static int lib_cvRegisterVar(lua_State *L)
|
||||||
#undef FIELDERROR
|
#undef FIELDERROR
|
||||||
#undef TYPEERROR
|
#undef TYPEERROR
|
||||||
|
|
||||||
|
if (!cvar->name)
|
||||||
|
return luaL_error(L, M_GetText("Variable has no name!\n"));
|
||||||
|
if ((cvar->flags & CV_NOINIT) && !(cvar->flags & CV_CALL))
|
||||||
|
return luaL_error(L, M_GetText("Variable %s has CV_NOINIT without CV_CALL\n"), cvar->name);
|
||||||
|
if ((cvar->flags & CV_CALL) && !cvar->func)
|
||||||
|
return luaL_error(L, M_GetText("Variable %s has CV_CALL without a function\n"), cvar->name);
|
||||||
|
|
||||||
// stack: cvar table, cvar userdata
|
// stack: cvar table, cvar userdata
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, "CV_Vars");
|
lua_getfield(L, LUA_REGISTRYINDEX, "CV_Vars");
|
||||||
I_Assert(lua_istable(L, 3));
|
I_Assert(lua_istable(L, 3));
|
||||||
|
|
Loading…
Reference in New Issue