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 e13ea66ed..905127df4 100644 Binary files a/engine/xdk/FTEQW_XDK.suo and b/engine/xdk/FTEQW_XDK.suo differ