mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
fix misc bugs/issues/warnings.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4751 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
1daac61ea9
commit
6c6999ce78
12 changed files with 49 additions and 52 deletions
|
@ -2864,6 +2864,8 @@ void CLQW_ParseServerData (void)
|
|||
Host_EndGame("Server sent us too many alternate clients\n");
|
||||
for (pnum = 0; pnum < cl.splitclients; pnum++)
|
||||
{
|
||||
if (cls.z_ext & Z_EXT_VIEWHEIGHT)
|
||||
cl.playerview[pnum].viewheight = 0;
|
||||
cl.playerview[pnum].playernum = MSG_ReadByte();
|
||||
if (cl.playerview[pnum].playernum >= cl.allocated_client_slots)
|
||||
Host_EndGame("unsupported local player slot\n");
|
||||
|
@ -2878,6 +2880,8 @@ void CLQW_ParseServerData (void)
|
|||
{
|
||||
if (clnum == MAX_SPLITS)
|
||||
Host_EndGame("Server sent us too many alternate clients\n");
|
||||
if (cls.z_ext & Z_EXT_VIEWHEIGHT)
|
||||
cl.playerview[pnum].viewheight = 0;
|
||||
cl.playerview[clnum].playernum = pnum;
|
||||
if (cl.playerview[clnum].playernum & 128)
|
||||
{
|
||||
|
|
|
@ -2752,7 +2752,7 @@ void M_Menu_ModelViewer_f(void)
|
|||
#else
|
||||
void M_Menu_ModelViewer_f(void)
|
||||
{
|
||||
Con_Printf("no.\n");
|
||||
Con_Printf("modelviewer: not in this build\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2772,6 +2772,9 @@ static void Mods_Draw(int x, int y, struct menucustom_s *c, struct menu_s *m)
|
|||
|
||||
mods->y = y;
|
||||
|
||||
if (!mods->nummanifests)
|
||||
Draw_FunString(x, y, "No games or mods known");
|
||||
|
||||
for (i = 0; y+8 <= ym && i < mods->nummanifests; y+=8, i++)
|
||||
{
|
||||
if (mousecursor_y >= y && mousecursor_y < y+8)
|
||||
|
|
|
@ -2180,7 +2180,7 @@ void Surf_GenBrushBatches(batch_t **batches, entity_t *ent)
|
|||
|
||||
// calculate dynamic lighting for bmodel if it's not an
|
||||
// instanced model
|
||||
if (model->fromgame != fg_quake3 && model->fromgame != fg_doom3)
|
||||
if (model->fromgame != fg_quake3 && model->fromgame != fg_doom3 && lightmap)
|
||||
{
|
||||
int k;
|
||||
|
||||
|
|
|
@ -3117,6 +3117,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
|||
#endif
|
||||
|
||||
#ifdef CATCHCRASH
|
||||
LoadLibrary ("DBGHELP"); //heap corruption can prevent loadlibrary from working properly, so do this in advance.
|
||||
#ifdef _MSC_VER
|
||||
__try
|
||||
#else
|
||||
|
|
|
@ -2448,7 +2448,7 @@ void BE_GenModelBatches(batch_t **batches, const dlight_t *dl, unsigned int bemo
|
|||
switch(ent->model->type)
|
||||
{
|
||||
case mod_brush:
|
||||
if (r_drawentities.ival == 2 || !lightmap)
|
||||
if (r_drawentities.ival == 2)
|
||||
continue;
|
||||
Surf_GenBrushBatches(batches, ent);
|
||||
break;
|
||||
|
|
|
@ -498,6 +498,8 @@ cont:
|
|||
{
|
||||
msg = "HTTP/1.1 400 Bad Request\r\n" /*"Content-Type: application/octet-stream\r\n"*/ "Content-Length: 69\r\n" "Server: "FULLENGINENAME"/0\r\n" "\r\n" "400 Bad Request\r\nYour client failed to provide the host header line";
|
||||
|
||||
IWebPrintf("%s: no host specified\n", cl->peername);
|
||||
|
||||
ammount = strlen(msg);
|
||||
ExpandOutBuffer(cl, ammount, true);
|
||||
memcpy(cl->outbuffer, msg, ammount);
|
||||
|
@ -540,7 +542,7 @@ cont:
|
|||
}
|
||||
if (!cl->file)
|
||||
{
|
||||
IWebPrintf("%s: Download rejected\n", cl->peername);
|
||||
IWebPrintf("%s: 404 - not found\n", cl->peername);
|
||||
|
||||
if (HTTPmarkup >= 3)
|
||||
msg = "HTTP/1.1 404 Not Found\r\n" "Content-Type: text/plain\r\n" "Content-Length: 15\r\n" "Server: "FULLENGINENAME"/0\r\n" "\r\n" "404 Bad address";
|
||||
|
@ -603,6 +605,7 @@ notimplemented:
|
|||
msg = NULL;
|
||||
cl->closereason = "unsupported http version";
|
||||
}
|
||||
IWebPrintf("%s: 501 - not implemented\n", cl->peername);
|
||||
|
||||
if (msg)
|
||||
{
|
||||
|
|
|
@ -1892,12 +1892,6 @@ QCC_def_t *QCC_PR_StatementFlags (QCC_opcode_t *op, QCC_def_t *var_a, QCC_def_t
|
|||
QCC_statement_t *statement;
|
||||
QCC_def_t *var_c=NULL, *temp=NULL;
|
||||
|
||||
if (outstatement == (QCC_statement_t **)0xffffffff)
|
||||
{
|
||||
outstatement = NULL;
|
||||
flags &= ~(STFL_CONVERTA|STFL_CONVERTB);
|
||||
}
|
||||
|
||||
if (op->priority != -1 && op->priority != CONDITION_PRIORITY)
|
||||
{
|
||||
if (op->associative!=ASSOC_LEFT)
|
||||
|
@ -3726,9 +3720,9 @@ QCC_def_t *QCC_PR_GenerateFunctionCall (QCC_def_t *newself, QCC_def_t *func, QCC
|
|||
else if (def_ret.temp->used)
|
||||
{
|
||||
if (def_ret.type->size == 3)
|
||||
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[OP_STORE_V], &def_ret, oldret, (void*)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(&pr_opcodes[OP_STORE_V], &def_ret, oldret, NULL, 0));
|
||||
else
|
||||
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[OP_STORE_F], &def_ret, oldret, (void*)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(&pr_opcodes[OP_STORE_F], &def_ret, oldret, NULL, 0));
|
||||
QCC_UnFreeTemp(oldret);
|
||||
QCC_UnFreeTemp(&def_ret);
|
||||
QCC_PR_ParseWarning(WARN_FIXEDRETURNVALUECONFLICT, "Return value conflict - output is inefficient");
|
||||
|
@ -3785,21 +3779,21 @@ QCC_def_t *QCC_PR_GenerateFunctionCall (QCC_def_t *newself, QCC_def_t *func, QCC
|
|||
if (t->type == ev_variant)
|
||||
{
|
||||
d = QCC_GetTemp(type_variant);
|
||||
QCC_FreeTemp(QCC_PR_Statement(pr_opcodes+OP_STORE_F, &def_ret, d, (void*)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(pr_opcodes+OP_STORE_F, &def_ret, d, NULL, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
d = QCC_GetTemp(t->aux_type);
|
||||
if (t->aux_type->size == 3)
|
||||
QCC_FreeTemp(QCC_PR_Statement(pr_opcodes+OP_STORE_V, &def_ret, d, (void*)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(pr_opcodes+OP_STORE_V, &def_ret, d, NULL, 0));
|
||||
else
|
||||
QCC_FreeTemp(QCC_PR_Statement(pr_opcodes+OP_STORE_F, &def_ret, d, (void*)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(pr_opcodes+OP_STORE_F, &def_ret, d, NULL, 0));
|
||||
}
|
||||
def_ret.type = oldrettype;
|
||||
if (def_ret.type->size == 3)
|
||||
QCC_FreeTemp(QCC_PR_Statement(pr_opcodes+OP_STORE_V, oldret, &def_ret, (void*)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(pr_opcodes+OP_STORE_V, oldret, &def_ret, NULL, 0));
|
||||
else
|
||||
QCC_FreeTemp(QCC_PR_Statement(pr_opcodes+OP_STORE_F, oldret, &def_ret, (void*)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(pr_opcodes+OP_STORE_F, oldret, &def_ret, NULL, 0));
|
||||
QCC_FreeTemp(oldret);
|
||||
QCC_UnFreeTemp(&def_ret);
|
||||
QCC_UnFreeTemp(d);
|
||||
|
@ -4433,16 +4427,16 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_ref_t *funcref) //warning, the func cou
|
|||
|
||||
e = QCC_PR_Expression(TOP_PRIORITY, EXPR_DISALLOW_COMMA);
|
||||
QCC_PR_Expect(")");
|
||||
e = QCC_PR_Statement(&pr_opcodes[OP_DIV_F], e, QCC_MakeIntConst(1), (QCC_statement_t **)0xffffffff);
|
||||
e = QCC_PR_StatementFlags(&pr_opcodes[OP_DIV_F], e, QCC_MakeIntConst(1), NULL, 0);
|
||||
|
||||
d = QCC_PR_GetDef(NULL, "nextent", NULL, false, 0, false);
|
||||
if (!d)
|
||||
QCC_PR_ParseError(0, "the nextent builtin is not defined");
|
||||
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[OP_STORE_F], e, &def_parms[0], (QCC_statement_t **)0xffffffff));
|
||||
d = QCC_PR_Statement(&pr_opcodes[OP_CALL0], d, NULL, NULL);
|
||||
d = QCC_PR_Statement(&pr_opcodes[OP_DIV_F], d, QCC_MakeIntConst(1), (QCC_statement_t **)0xffffffff);
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(&pr_opcodes[OP_STORE_F], e, &def_parms[0], NULL, 0));
|
||||
d = QCC_PR_StatementFlags(&pr_opcodes[OP_CALL0], d, NULL, NULL, 0);
|
||||
d = QCC_PR_StatementFlags(&pr_opcodes[OP_DIV_F], d, QCC_MakeIntConst(1), NULL, 0);
|
||||
|
||||
e = QCC_PR_Statement(&pr_opcodes[OP_DIV_F], e, d, (QCC_statement_t **)0xffffffff);
|
||||
e = QCC_PR_StatementFlags(&pr_opcodes[OP_DIV_F], e, d, NULL, 0);
|
||||
|
||||
return e;
|
||||
}
|
||||
|
@ -4512,11 +4506,11 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_ref_t *funcref) //warning, the func cou
|
|||
e = &def_parms[arg];
|
||||
|
||||
e->ofs = OFS_PARM0+0;
|
||||
QCC_FreeTemp(QCC_PR_Statement (&pr_opcodes[OP_STORE_F], QCC_MakeFloatConst(pr_immediate.vector[0]), e, (QCC_statement_t **)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags (&pr_opcodes[OP_STORE_F], QCC_MakeFloatConst(pr_immediate.vector[0]), e, NULL, 0));
|
||||
e->ofs = OFS_PARM0+1;
|
||||
QCC_FreeTemp(QCC_PR_Statement (&pr_opcodes[OP_STORE_F], QCC_MakeFloatConst(pr_immediate.vector[1]), e, (QCC_statement_t **)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags (&pr_opcodes[OP_STORE_F], QCC_MakeFloatConst(pr_immediate.vector[1]), e, NULL, 0));
|
||||
e->ofs = OFS_PARM0+2;
|
||||
QCC_FreeTemp(QCC_PR_Statement (&pr_opcodes[OP_STORE_F], QCC_MakeFloatConst(pr_immediate.vector[2]), e, (QCC_statement_t **)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags (&pr_opcodes[OP_STORE_F], QCC_MakeFloatConst(pr_immediate.vector[2]), e, NULL, 0));
|
||||
e->ofs = OFS_PARM0;
|
||||
e->type = type_vector;
|
||||
|
||||
|
@ -5624,19 +5618,19 @@ QCC_ref_t *QCC_PR_ParseRefValue (QCC_ref_t *refbuf, QCC_type_t *assumeclass, pbo
|
|||
d = QCC_GetTemp(type_vector);
|
||||
d->type = type_float;
|
||||
if (x->type->type == ev_float)
|
||||
QCC_PR_Statement(pr_opcodes + OP_STORE_F, x, d, (QCC_statement_t **)0xffffffff);
|
||||
QCC_PR_StatementFlags(pr_opcodes + OP_STORE_F, x, d, NULL, 0);
|
||||
else
|
||||
QCC_PR_Statement(pr_opcodes+OP_CONV_ITOF, x, d, (QCC_statement_t **)0xffffffff);
|
||||
QCC_PR_StatementFlags(pr_opcodes+OP_CONV_ITOF, x, d, NULL, 0);
|
||||
d->ofs++;
|
||||
if (y->type->type == ev_float)
|
||||
QCC_PR_Statement(pr_opcodes + OP_STORE_F, y, d, (QCC_statement_t **)0xffffffff);
|
||||
QCC_PR_StatementFlags(pr_opcodes + OP_STORE_F, y, d, NULL, 0);
|
||||
else
|
||||
QCC_PR_Statement(pr_opcodes+OP_CONV_ITOF, y, d, (QCC_statement_t **)0xffffffff);
|
||||
QCC_PR_StatementFlags(pr_opcodes+OP_CONV_ITOF, y, d, NULL, 0);
|
||||
d->ofs++;
|
||||
if (z->type->type == ev_float)
|
||||
QCC_PR_Statement(pr_opcodes + OP_STORE_F, z, d, (QCC_statement_t **)0xffffffff);
|
||||
QCC_PR_StatementFlags(pr_opcodes + OP_STORE_F, z, d, NULL, 0);
|
||||
else
|
||||
QCC_PR_Statement(pr_opcodes+OP_CONV_ITOF, z, d, (QCC_statement_t **)0xffffffff);
|
||||
QCC_PR_StatementFlags(pr_opcodes+OP_CONV_ITOF, z, d, NULL, 0);
|
||||
d->ofs++;
|
||||
d->ofs -= 3;
|
||||
d->type = type_vector;
|
||||
|
@ -6184,7 +6178,7 @@ void QCC_StoreToOffset(int dest, int source, QCC_type_t *type)
|
|||
}*/
|
||||
void QCC_StoreToDef(QCC_def_t *dest, QCC_def_t *source, QCC_type_t *type, pbool preservesource, pbool preservedest)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
int flags = 0;
|
||||
if (preservesource)
|
||||
flags |= STFL_PRESERVEA;
|
||||
|
@ -6540,7 +6534,7 @@ QCC_def_t *QCC_LoadFromArray(QCC_def_t *base, QCC_def_t *index, QCC_type_t *t, p
|
|||
for (i = 0; i < t->size; i++)
|
||||
{
|
||||
if (i)
|
||||
args[0] = QCC_PR_Statement(&pr_opcodes[OP_ADD_F], index, QCC_MakeFloatConst(i), (QCC_statement_t **)0xffffffff);
|
||||
args[0] = QCC_PR_StatementFlags(&pr_opcodes[OP_ADD_F], index, QCC_MakeFloatConst(i), NULL, 0);
|
||||
else
|
||||
{
|
||||
args[0] = index;
|
||||
|
@ -6549,7 +6543,7 @@ QCC_def_t *QCC_LoadFromArray(QCC_def_t *base, QCC_def_t *index, QCC_type_t *t, p
|
|||
r = QCC_PR_GenerateFunctionCall(NULL, funcretr, args, &type_float, 1);
|
||||
opt_assignments = old_op;
|
||||
QCC_UnFreeTemp(index);
|
||||
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[OP_STORE_F], r, base, (QCC_statement_t **)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(&pr_opcodes[OP_STORE_F], r, base, NULL, 0));
|
||||
base->ofs++;
|
||||
}
|
||||
QCC_FreeTemp(index);
|
||||
|
@ -7071,7 +7065,7 @@ QCC_ref_t *QCC_PR_RefExpression (QCC_ref_t *retbuf, int priority, int exprflags)
|
|||
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[OP_IFNOT_I], QCC_RefToDef(lhsr, true), NULL, &fromj));
|
||||
val = QCC_PR_Expression(TOP_PRIORITY, EXPR_DISALLOW_COMMA);
|
||||
r = QCC_GetTemp(val->type);
|
||||
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[(r->type->size>=3)?OP_STORE_V:OP_STORE_F], val, r, (QCC_statement_t **)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(&pr_opcodes[(r->type->size>=3)?OP_STORE_V:OP_STORE_F], val, r, NULL, 0));
|
||||
//r can be stomped upon until its reused anyway
|
||||
QCC_UnFreeTemp(r);
|
||||
|
||||
|
@ -7082,7 +7076,7 @@ QCC_ref_t *QCC_PR_RefExpression (QCC_ref_t *retbuf, int priority, int exprflags)
|
|||
|
||||
if (typecmp(val->type, r->type) != 0)
|
||||
QCC_PR_ParseError(0, "Ternary operator with mismatching types\n");
|
||||
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[(r->type->size>=3)?OP_STORE_V:OP_STORE_F], val, r, (QCC_statement_t **)0xffffffff));
|
||||
QCC_FreeTemp(QCC_PR_StatementFlags(&pr_opcodes[(r->type->size>=3)?OP_STORE_V:OP_STORE_F], val, r, NULL, 0));
|
||||
QCC_UnFreeTemp(r);
|
||||
|
||||
elsej->a = &statements[numstatements] - elsej;
|
||||
|
|
|
@ -896,7 +896,7 @@ pbool QCC_WriteData (int crc)
|
|||
// else
|
||||
// QCC_PR_Warning(WARN_DEADCODE, strings + def->s_file, def->s_line, "%s is never directly called", def->name);
|
||||
}
|
||||
if (opt_stripfunctions && def->timescalled >= def->references-1) //make sure it's not copied into a different var.
|
||||
if (opt_stripfunctions && def->constant && def->timescalled >= def->references-1) //make sure it's not copied into a different var.
|
||||
{ //if it ever does self.think then it could be needed for saves.
|
||||
optres_stripfunctions++; //if it's only ever called explicitly, the engine doesn't need to know.
|
||||
continue;
|
||||
|
|
|
@ -575,6 +575,7 @@ void PR_Deinit(void)
|
|||
PR_Common_Shutdown(svprogfuncs, false);
|
||||
if (svprogfuncs->CloseProgs)
|
||||
svprogfuncs->CloseProgs(svprogfuncs);
|
||||
sv.world.progs = NULL;
|
||||
svprogfuncs=NULL;
|
||||
|
||||
for (i = 0; i < MAX_LIGHTSTYLES; i++)
|
||||
|
|
|
@ -1526,6 +1526,7 @@ SERVICE_TABLE_ENTRY DispatchTable[] =
|
|||
int main (int argc, char **argv)
|
||||
{
|
||||
#ifdef CATCHCRASH
|
||||
LoadLibrary ("DBGHELP"); //heap corruption can prevent loadlibrary from working properly, so do this in advance.
|
||||
#ifdef _MSC_VER
|
||||
__try
|
||||
#else
|
||||
|
|
|
@ -3530,7 +3530,8 @@ void SV_Kill_f (void)
|
|||
pr_global_struct->time = sv.world.physicstime;
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, sv_player);
|
||||
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->ClientKill);
|
||||
if (pr_global_ptrs->ClientKill)
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->ClientKill);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4328,6 +4329,9 @@ void Cmd_SetPos_f(void)
|
|||
SV_TPrintToClient(host_client, PRINT_HIGH, "noclip on\n");
|
||||
}
|
||||
|
||||
//make sure they're not going to whizz away from it
|
||||
VectorClear(sv_player->v->velocity);
|
||||
|
||||
sv_player->v->origin[0] = atof(Cmd_Argv(1));
|
||||
sv_player->v->origin[1] = atof(Cmd_Argv(2));
|
||||
sv_player->v->origin[2] = atof(Cmd_Argv(3));
|
||||
|
|
|
@ -798,20 +798,6 @@ qboolean SVQ2_InitGameProgs(void)
|
|||
if (sv.world.worldmodel && (sv.world.worldmodel->fromgame == fg_quake || sv.world.worldmodel->fromgame == fg_halflife))
|
||||
{
|
||||
return false;
|
||||
/*
|
||||
import.linkentity = SVQ2_Q1BSP_LinkEdict;
|
||||
import.unlinkentity = SVQ2_Q1BSP_UnlinkEdict;
|
||||
import.BoxEdicts = SVQ2_Q1BSP_AreaEdicts;
|
||||
import.trace = SVQ2_Q1BSP_Trace;
|
||||
import.pointcontents = SVQ2_Q1BSP_PointContents;
|
||||
import.setmodel = PFQ2_Q1BSP_setmodel;
|
||||
import.inPVS = PFQ2_Q1BSP_inPVS;
|
||||
import.inPHS = PFQ2_Q1BSP_inPHS;
|
||||
import.Pmove = Q2_Pmove;
|
||||
|
||||
import.AreasConnected = PFQ2_Q1BSP_AreasConnected;
|
||||
import.SetAreaPortalState = CMQ2_Q1BSP_SetAreaPortalState;
|
||||
*/
|
||||
}
|
||||
|
||||
ge = (game_export_t *)SVQ2_GetGameAPI ((game_import_t*)&import);
|
||||
|
|
Loading…
Reference in a new issue