diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 9b9a0762e..9523416b3 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -364,9 +364,10 @@ void M_Menu_Particles_f (void) menu->selecteditem = (union menuoption_s *) + MC_AddConsoleCommand(menu, 16, y, " Choose particle set", "menu_particleset");y+=8; MC_AddCheckBox(menu, 16, y, " sparks bounce", &r_bouncysparks,0);y+=8; // MC_AddSlider(menu, 16, y, " exp spark count", &r_particles_in_explosion, 16, 1024);y+=8; - MC_AddCvarCombo(menu, 16, y, " rain effect", &r_part_rain, r_part_rain_options, r_part_rain_values);y+=8; + MC_AddCvarCombo(menu, 16, y, " texture emittance", &r_part_rain, r_part_rain_options, r_part_rain_values);y+=8; #ifdef RGLQUAKE if (qrenderer == QR_OPENGL) //sw doesn't have these. diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 1f902c78a..fabd4f784 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -136,11 +136,11 @@ csqcedict_t *csqc_edicts; //consider this 'world' void CSQC_InitFields(void) { //CHANGING THIS FUNCTION REQUIRES CHANGES TO csqcentvars_t -#define fieldfloat(name) PR_RegisterFieldVar(csqcprogs, ev_float, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) -#define fieldvector(name) PR_RegisterFieldVar(csqcprogs, ev_vector, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) -#define fieldentity(name) PR_RegisterFieldVar(csqcprogs, ev_entity, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) -#define fieldstring(name) PR_RegisterFieldVar(csqcprogs, ev_string, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) -#define fieldfunction(name) PR_RegisterFieldVar(csqcprogs, ev_function, #name, (int)&((csqcedict_t*)0)->v->name - (int)&((csqcedict_t*)0)->v, -1) +#define fieldfloat(name) PR_RegisterFieldVar(csqcprogs, ev_float, #name, (int)&((csqcentvars_t*)0)->name, -1) +#define fieldvector(name) PR_RegisterFieldVar(csqcprogs, ev_vector, #name, (int)&((csqcentvars_t*)0)->name, -1) +#define fieldentity(name) PR_RegisterFieldVar(csqcprogs, ev_entity, #name, (int)&((csqcentvars_t*)0)->name, -1) +#define fieldstring(name) PR_RegisterFieldVar(csqcprogs, ev_string, #name, (int)&((csqcentvars_t*)0)->name, -1) +#define fieldfunction(name) PR_RegisterFieldVar(csqcprogs, ev_function, #name, (int)&((csqcentvars_t*)0)->name, -1) csqcfields #undef fieldfloat #undef fieldvector @@ -339,6 +339,7 @@ static void PF_R_AddEntity(progfuncs_t *prinst, struct globalvars_s *pr_globals) ent.alpha = in->v->alpha; ent.scale = in->v->scale; + ent.skinnum = in->v->skin; V_AddEntity(&ent); } @@ -1297,7 +1298,7 @@ qboolean CSQC_Init (unsigned int checksum) csqcprogparms.printf = (void *)Con_Printf;//Con_Printf;//void (*printf) (char *, ...); csqcprogparms.Sys_Error = Sys_Error; csqcprogparms.Abort = CSQC_Abort; - csqcprogparms.edictsize = sizeof(csqcedict_t)-sizeof(csqcentvars_t); + csqcprogparms.edictsize = sizeof(csqcedict_t); csqcprogparms.entspawn = NULL;//void (*entspawn) (struct edict_s *ent); //ent has been spawned, but may not have all the extra variables (that may need to be set) set csqcprogparms.entcanfree = NULL;//bool (*entcanfree) (struct edict_s *ent); //return true to stop ent from being freed diff --git a/engine/client/pr_menu.c b/engine/client/pr_menu.c index e64169bcd..fddd1d75a 100644 --- a/engine/client/pr_menu.c +++ b/engine/client/pr_menu.c @@ -773,12 +773,12 @@ static void PF_Remove_ (progfuncs_t *prinst, struct globalvars_s *pr_globals) static void PF_CopyEntity (progfuncs_t *prinst, struct globalvars_s *pr_globals) { - void *in, *out; + menuedict_t *in, *out; - in = G_EDICT(prinst, OFS_PARM0); - out = G_EDICT(prinst, OFS_PARM1); + in = (menuedict_t*)G_EDICT(prinst, OFS_PARM0); + out = (menuedict_t*)G_EDICT(prinst, OFS_PARM1); - memcpy((char*)out+prinst->parms->edictsize, (char*)in+prinst->parms->edictsize, menuentsize-prinst->parms->edictsize); + memcpy(out->fields, in->fields, menuentsize); } void PF_gethostcachevalue (progfuncs_t *prinst, struct globalvars_s *pr_globals) @@ -865,63 +865,61 @@ void PF_menu_findchain (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; char *s, *t; - edict_t *ent, *chain; //note, all edicts share the common header, but don't use it's fields! + menuedict_t *ent, *chain; //note, all edicts share the common header, but don't use it's fields! eval_t *val; - chain = (edict_t *) *prinst->parms->sv_edicts; + chain = (menuedict_t *) *prinst->parms->sv_edicts; f = G_INT(OFS_PARM0)+prinst->fieldadjust; - f += prinst->parms->edictsize/4; s = PR_GetStringOfs(prinst, OFS_PARM1); for (i = 1; i < *prinst->parms->sv_num_edicts; i++) { - ent = EDICT_NUM(prinst, i); + ent = (menuedict_t *)EDICT_NUM(prinst, i); if (ent->isfree) continue; - t = *(string_t *)&((float*)ent)[f] + prinst->stringtable; + t = *(string_t *)&((float*)ent->fields)[f] + prinst->stringtable; if (!t) continue; if (strcmp(t, s)) continue; - val = prinst->GetEdictFieldValue(prinst, ent, "chain", NULL); + val = prinst->GetEdictFieldValue(prinst, (void*)ent, "chain", NULL); if (val) - val->edict = EDICT_TO_PROG(prinst, chain); + val->edict = EDICT_TO_PROG(prinst, (void*)chain); chain = ent; } - RETURN_EDICT(prinst, chain); + RETURN_EDICT(prinst, (void*)chain); } //entity findchainfloat(.float _field, float match) = #27; void PF_menu_findchainfloat (progfuncs_t *prinst, struct globalvars_s *pr_globals) { int i, f; float s; - edict_t *ent, *chain; //note, all edicts share the common header, but don't use it's fields! + menuedict_t *ent, *chain; //note, all edicts share the common header, but don't use it's fields! eval_t *val; - chain = (edict_t *) *prinst->parms->sv_edicts; + chain = (menuedict_t *) *prinst->parms->sv_edicts; f = G_INT(OFS_PARM0)+prinst->fieldadjust; - f += prinst->parms->edictsize/4; s = G_FLOAT(OFS_PARM1); for (i = 1; i < *prinst->parms->sv_num_edicts; i++) { - ent = EDICT_NUM(prinst, i); + ent = (menuedict_t*)EDICT_NUM(prinst, i); if (ent->isfree) continue; - if (((float *)ent)[f] != s) + if (((float *)ent->fields)[f] != s) continue; - val = prinst->GetEdictFieldValue(prinst, ent, "chain", NULL); + val = prinst->GetEdictFieldValue(prinst, (void*)ent, "chain", NULL); if (val) - val->edict = EDICT_TO_PROG(prinst, chain); + val->edict = EDICT_TO_PROG(prinst, (void*)chain); chain = ent; } - RETURN_EDICT(prinst, chain); + RETURN_EDICT(prinst, (void*)chain); } void PF_etof(progfuncs_t *prinst, struct globalvars_s *pr_globals) @@ -1432,7 +1430,6 @@ void MP_Init (void) mp_keydown_function = PR_FindFunction(menuprogs, "m_keydown", PR_ANY); mp_keyup_function = PR_FindFunction(menuprogs, "m_keyup", PR_ANY); mp_toggle_function = PR_FindFunction(menuprogs, "m_toggle", PR_ANY); - if (mp_init_function) PR_ExecuteProgram(menuprogs, mp_init_function); inmenuprogs--; diff --git a/engine/client/winquake.rc b/engine/client/winquake.rc index f56f8914d..976811c65 100644 --- a/engine/client/winquake.rc +++ b/engine/client/winquake.rc @@ -56,10 +56,10 @@ IDD_DIALOG1 DIALOGEX 0, 0, 67, 40 STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE -FONT 16, "Times New Roman", 0, 0, 0x1 +FONT 16, "Times New Roman" BEGIN CTEXT "FTE QuakeWorld",IDC_STATIC,0,0,67,21,SS_CENTERIMAGE - CTEXT "http://fte.quakesrc.org",IDC_STATIC,0,23,66,17, + CTEXT "http://fteqw.sf.net",IDC_STATIC,0,23,66,17, SS_CENTERIMAGE END diff --git a/engine/common/zone.c b/engine/common/zone.c index e9b914484..d1795c72d 100644 --- a/engine/common/zone.c +++ b/engine/common/zone.c @@ -42,7 +42,7 @@ void Cache_FreeHigh (int new_high_hunk); //must be multiple of 4. #define TEMPDEBUG 4 -#define ZONEDEBUG 4 +#define ZONEDEBUG 64 #define HUNKDEBUG 4 #define CACHEDEBUG 4 @@ -221,7 +221,7 @@ void BZ_CheckSentinals(void *c) #endif } -/* //revive this function each time you get memory corruption and need to trace it. + //revive this function each time you get memory corruption and need to trace it. void BZ_CheckAllSentinals(void) { zone_t *zone; @@ -245,7 +245,7 @@ void BZ_CheckAllSentinals(void) } } } -*/ + void VARGS Z_FreeTags(int tag) { diff --git a/engine/qclib/execloop16d.h b/engine/qclib/execloop16d.h index ded81fbfd..3e8cc2402 100644 --- a/engine/qclib/execloop16d.h +++ b/engine/qclib/execloop16d.h @@ -650,7 +650,7 @@ reeval: //array/structure reading/riting. - case OP_GLOBALADDRESS: + case OP_GLOBALADDRESS: OPC->_int = (int)(&((int)(OPA->_int)) + OPB->_int); break; case OP_POINTER_ADD: //pointer to 32 bit (remember to *3 for vectors) diff --git a/engine/qclib/execloop32.h b/engine/qclib/execloop32.h index ded81fbfd..3e8cc2402 100644 --- a/engine/qclib/execloop32.h +++ b/engine/qclib/execloop32.h @@ -650,7 +650,7 @@ reeval: //array/structure reading/riting. - case OP_GLOBALADDRESS: + case OP_GLOBALADDRESS: OPC->_int = (int)(&((int)(OPA->_int)) + OPB->_int); break; case OP_POINTER_ADD: //pointer to 32 bit (remember to *3 for vectors) diff --git a/engine/qclib/execloop32d.h b/engine/qclib/execloop32d.h index ded81fbfd..3e8cc2402 100644 --- a/engine/qclib/execloop32d.h +++ b/engine/qclib/execloop32d.h @@ -650,7 +650,7 @@ reeval: //array/structure reading/riting. - case OP_GLOBALADDRESS: + case OP_GLOBALADDRESS: OPC->_int = (int)(&((int)(OPA->_int)) + OPB->_int); break; case OP_POINTER_ADD: //pointer to 32 bit (remember to *3 for vectors) diff --git a/engine/qclib/pr_edict.c b/engine/qclib/pr_edict.c index aac4ccf55..ce9237dbd 100644 --- a/engine/qclib/pr_edict.c +++ b/engine/qclib/pr_edict.c @@ -580,7 +580,7 @@ char *PR_UglyValueString (progfuncs_t *progfuncs, etype_t type, eval_t *val) sprintf (line, "unions cannot yet be saved"); break; case ev_string: - sprintf (line, "%s", val->string+progfuncs->stringtable); + _snprintf (line, sizeof(line), "%s", val->string+progfuncs->stringtable); break; case ev_entity: sprintf (line, "%i", NUM_FOR_EDICT(progfuncs, (struct edict_s *)PROG_TO_EDICT(progfuncs, val->edict))); diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 24ec1fa8b..f198e0cc0 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -4981,6 +4981,7 @@ void PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals) (*prinst->pr_trace) = 1; return; } + ((int *)s)[0] = 0xabcd1234; Z_Free(s); } void PF_strlen(progfuncs_t *prinst, struct globalvars_s *pr_globals) @@ -6363,7 +6364,7 @@ static void PF_copyentity (progfuncs_t *prinst, struct globalvars_s *pr_globals) in = G_EDICT(prinst, OFS_PARM0); out = G_EDICT(prinst, OFS_PARM1); - memcpy(&out->v, &in->v, pr_edict_size-prinst->parms->edictsize); + memcpy(out->v, in->v, pr_edict_size); SV_LinkEdict(out, false); } diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index eeb19e81f..557f8efe8 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -2601,7 +2601,8 @@ void ED_ClearEdict (progfuncs_t *progfuncs, edict_t *e); void SetUpClientEdict (client_t *cl, edict_t *ent) { extern int pr_teamfield; - ED_ClearEdict(svprogfuncs, ent); + if (progstype != PROG_NQ) //allow frikbots to work in NQ mods (but not qw!) + ED_ClearEdict(svprogfuncs, ent); ED_Spawned(ent); ent->isfree = false;