Builtin for movetype_push ents, wastes config changes

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5113 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Eukara 2017-06-15 14:23:26 +00:00
parent ca31acefea
commit 5e2a985f7f
7 changed files with 30 additions and 7 deletions

View File

@ -5946,7 +5946,7 @@ static struct {
{"getmodeleventidx", PF_getmodeleventidx, 0},
{"crossproduct", PF_crossproduct, 0},
{"pushmove", PF_pushmove, 0},
#ifdef TERRAIN
{"terrain_edit", PF_terrain_edit, 278},//void(float action, vector pos, float radius, float quant) terrain_edit = #278 (??FTE_TERRAIN_EDIT??)
{"brush_get", PF_brush_get, 0},

View File

@ -28,6 +28,7 @@
#undef VKQUAKE
#undef HEADLESSQUAKE
#define HAVE_PACKET
#define QUAKETC
#define AVAIL_OPENAL
#define AVAIL_ZLIB

View File

@ -5890,7 +5890,24 @@ void QCBUILTIN PF_physics_addtorque(pubprogfuncs_t *prinst, struct globalvars_s
}
#endif
/*
=============
PF_pushmove
=============
*/
void QCBUILTIN PF_pushmove (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{
world_t *world = prinst->parms->user;
wedict_t *ent;
float *move;
float *amove;
ent = G_WEDICT(prinst, OFS_PARM0);
move = G_VECTOR(OFS_PARM1);
amove = G_VECTOR(OFS_PARM2);
G_FLOAT(OFS_RETURN) = WPhys_Push(world, ent, move, amove);
}
void PR_Common_Shutdown(pubprogfuncs_t *progs, qboolean errored)
{

View File

@ -70,6 +70,7 @@ extern int qcinput_scan;
extern int qcinput_unicode;
int MP_TranslateFTEtoQCCodes(int code);
int MP_TranslateQCtoFTECodes(int code);
qboolean WPhys_Push (world_t *w, wedict_t *pusher, vec3_t move, vec3_t amove);
//pr_cmds.c builtins that need to be moved to a common.
void VARGS PR_BIError(pubprogfuncs_t *progfuncs, char *format, ...) LIKEPRINTF(2);
@ -270,6 +271,9 @@ void QCBUILTIN PF_physics_supported(pubprogfuncs_t *prinst, struct globalvars_s
void QCBUILTIN PF_physics_enable(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_physics_addforce(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_physics_addtorque(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_pushmove(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
#ifdef TERRAIN
void QCBUILTIN PF_terrain_edit(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
void QCBUILTIN PF_brush_get(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals);
@ -826,4 +830,4 @@ enum
};
#ifdef __cplusplus
};
#endif
#endif

View File

@ -10337,9 +10337,8 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"processmodelevents",PF_processmodelevents,0, 0, 0, 0, D("void(float modidx, float framenum, __inout float basetime, float targettime, void(float timestamp, int code, string data) callback)", "Calls a callback for each event that has been reached. Basetime is set to targettime.")},
{"getnextmodelevent",PF_getnextmodelevent,0, 0, 0, 0, D("float(float modidx, float framenum, __inout float basetime, float targettime, __out int code, __out string data)", "Reports the next event within a model's animation. Returns a boolean if an event was found between basetime and targettime. Writes to basetime,code,data arguments (if an event was found, basetime is set to the event's time, otherwise to targettime).\nWARNING: this builtin cannot deal with multiple events with the same timestamp (only the first will be reported).")},
{"getmodeleventidx",PF_getmodeleventidx,0, 0, 0, 0, D("float(float modidx, float framenum, int eventidx, __out float timestamp, __out int code, __out string data)", "Reports an indexed event within a model's animation. Writes to timestamp,code,data arguments on success. Returns false if the animation/event/model was out of range/invalid. Does not consider looping animations (retry from index 0 if it fails and you know that its a looping animation). This builtin is more annoying to use than getnextmodelevent, but can be made to deal with multiple events with the exact same timestamp.")},
{"crossproduct", PF_crossproduct, 0, 0, 0, 0, D("#define dotproduct(v1,v2) ((vector)(v1)*(vector)(v2))\nvector(vector v1, vector v2)", "Small helper function to calculate the crossproduct of two vectors.")},
{"pushmove", PF_pushmove, 0, 0, 0, 0, "float(entity pusher, vector move, vector amove)"},
#ifdef TERRAIN
{"terrain_edit", PF_terrain_edit, 0, 0, 0, 278, D("void(float action, optional vector pos, optional float radius, optional float quant, ...)", "Realtime terrain editing. Actions are the TEREDIT_ constants.")},// (??FTE_TERRAIN_EDIT??
@ -10746,7 +10745,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"physics_addforce",PF_physics_addforce,0, 0, 0, 541, D("void(entity e, vector force, vector relative_ofs)", "Apply some impulse directional force upon a MOVETYPE_PHYSICS entity.")},
{"physics_addtorque",PF_physics_addtorque,0, 0, 0, 542, D("void(entity e, vector torque)", "Apply some impulse rotational force upon a MOVETYPE_PHYSICS entity.")},
#endif
{"setkeydest", PF_Fixme, 0, 0, 0, 601, "void(float dest)"},
{"getkeydest", PF_Fixme, 0, 0, 0, 602, "float()"},
{"setmousetarget", PF_Fixme, 0, 0, 0, 603, "void(float trg)"},
@ -10797,7 +10796,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"getrmqeffectsversion",PF_Ignore, 0, 0, 0, 666, "float()" STUB},
//don't exceed sizeof(pr_builtin)/sizeof(pr_builtin[0]) (currently 1024) without modifing the size of pr_builtin
{NULL}
};

View File

@ -856,7 +856,7 @@ SV_Push
============
*/
static qboolean WPhys_Push (world_t *w, wedict_t *pusher, vec3_t move, vec3_t amove)
qboolean WPhys_Push (world_t *w, wedict_t *pusher, vec3_t move, vec3_t amove)
{
#define PUSHABLE_LIMIT 8192
int i, e;
@ -1013,6 +1013,8 @@ static qboolean WPhys_Push (world_t *w, wedict_t *pusher, vec3_t move, vec3_t am
else
#endif
PR_ExecuteProgram (w->progs, pusher->v->blocked);
} else {
*w->g.other = 0;
}
// move back any entities we already moved

Binary file not shown.