From 5e2a985f7fb5b256a375f8043b80fa61df1a6b31 Mon Sep 17 00:00:00 2001 From: Eukara Date: Thu, 15 Jun 2017 14:23:26 +0000 Subject: [PATCH] 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 --- engine/client/pr_csqc.c | 2 +- engine/common/config_wastes.h | 1 + engine/common/pr_bgcmd.c | 17 +++++++++++++++++ engine/common/pr_common.h | 6 +++++- engine/server/pr_cmds.c | 7 +++---- engine/server/sv_phys.c | 4 +++- engine/xdk/FTEQW_XDK.suo | Bin 13312 -> 13312 bytes 7 files changed, 30 insertions(+), 7 deletions(-) diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index b9cd0387a..accddbe77 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -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}, diff --git a/engine/common/config_wastes.h b/engine/common/config_wastes.h index 64b752ad9..650f6ed6f 100644 --- a/engine/common/config_wastes.h +++ b/engine/common/config_wastes.h @@ -28,6 +28,7 @@ #undef VKQUAKE #undef HEADLESSQUAKE +#define HAVE_PACKET #define QUAKETC #define AVAIL_OPENAL #define AVAIL_ZLIB diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index a8db67c57..75be8119e 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -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) { diff --git a/engine/common/pr_common.h b/engine/common/pr_common.h index 901fc1b1b..47ef441b2 100644 --- a/engine/common/pr_common.h +++ b/engine/common/pr_common.h @@ -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 \ No newline at end of file +#endif diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 7a3ebfb89..2367f9342 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -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} }; diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index c47d55ceb..ad5d0b8cb 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -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 diff --git a/engine/xdk/FTEQW_XDK.suo b/engine/xdk/FTEQW_XDK.suo index e13ea66eda914e943e511a359105ff4145ed0f25..905127df4ff4dfd3a252cfe9b944a00fa4182c96 100644 GIT binary patch delta 511 zcmZq3Xvo+Q!Ne#&`5?Rf#)J&UNh~>h4>s3K6k2(Sk(q&kp+RnQ70W3mmSP}#vIl#O zVkwaE@Bjb*B~ZEyNS6a~1rS$)#3lwxZ{qmD&aTA>-rTNU$t16e&maco&GK5YjPhy(6wTK5 zWt?22&5hME8<1Nj-`35u5N8l%@nGU&VEF%E1HXw@jMWT|3`PuY46Y33YQO*ymWToR zHyh?>pl8pnHW7NiZ|%KF>LQc%b)5La88R927=jt{8Il>Y86qazt4N9gnK?k=RG>r& hLkvS1m|Z@3h4x7dM=AS}J zY>d-4%Sc*qgN&YhkXLhZgNlR#9}@#m6Br2C9$|$t8GcxU*{m*;6|^pI?pEbt6vdQg zVs!vY-`?D=Udbe{hTovg@>;Qs^6CT>&DQp1RM5b$$Oh!3$+va$_#uu}@Cjf8ve@i^ z;u->KP#>IKZ6fr3-`abV1;s@t=W4Z0?pEbvFJs7LNM$IW{7yG~GPfZwqwHi!Lm6f! NHaD;@ryFE40|3#MU}OLQ