]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
MOVETYPE_FLY_WORLDONLY (movetype 33)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 16 Aug 2011 12:10:18 +0000 (12:10 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Tue, 16 Aug 2011 20:41:19 +0000 (22:41 +0200)
Can't explain here what it does, Captain Obvious would enjoy it too much.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11281 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=386d8ad395308eb4977346110b348562f3eadfb8

dpdefs/dpextensions.qc
server.h
sv_phys.c
svvm_cmds.c

index a0e5a36cd5a480d85d30fba5d624a0f4114bf2b7..91f5ee23d77bbf5278919618dc20daf4df2c7bd8 100644 (file)
@@ -520,6 +520,14 @@ void(entity e, entity tagentity, string tagname) setattachment = #443; // attach
 //description:
 //MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts.
 
+//DP_MOVETYPEFLYWORLDONLY
+//idea: Samual
+//darkplaces implementation: Samual
+//movetype definitions:
+float MOVETYPE_FLY_WORLDONLY = 33;
+//description:
+//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER.
+
 //DP_NULL_MODEL
 //idea: Chris
 //darkplaces implementation: divVerent
index b8339b2eff4789e17cf29a1227c1061ec9722ce2..ed552a1422b187dfa6b1bd7c1187422beff85d83 100644 (file)
--- a/server.h
+++ b/server.h
@@ -317,6 +317,7 @@ typedef struct client_s
 #define MOVETYPE_FOLLOW                        12              ///< track movement of aiment
 #define MOVETYPE_FAKEPUSH              13              ///< tenebrae's push that doesn't push
 #define MOVETYPE_PHYSICS               32              ///< indicates this object is physics controlled
+#define MOVETYPE_FLY_WORLDONLY         33              ///< like MOVETYPE_FLY, but uses MOVE_WORLDONLY for all its traces; objects of this movetype better be SOLID_NOT or SOLID_TRIGGER please, or else...
 
 // edict->solid values
 #define        SOLID_NOT                               0               ///< no interaction with other objects
index 24276208d401cdff987cfdc66ece0feb19862e91..7b9d705a4bd3d4270c549774fb6df9c9be38157e 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -919,7 +919,7 @@ static int SV_TestEntityPosition (prvm_edict_t *ent, vec3_t offset)
        trace_t trace;
        contents = SV_GenericHitSuperContentsMask(ent);
        VectorAdd(PRVM_serveredictvector(ent, origin), offset, org);
-       trace = SV_TraceBox(org, PRVM_serveredictvector(ent, mins), PRVM_serveredictvector(ent, maxs), PRVM_serveredictvector(ent, origin), MOVE_NOMONSTERS, ent, contents);
+       trace = SV_TraceBox(org, PRVM_serveredictvector(ent, mins), PRVM_serveredictvector(ent, maxs), PRVM_serveredictvector(ent, origin), ((PRVM_serveredictfloat(ent, movetype) == MOVETYPE_FLY_WORLDONLY) ? MOVE_WORLDONLY : MOVE_NOMONSTERS), ent, contents);
        if (trace.startsupercontents & contents)
                return true;
        else
@@ -987,7 +987,8 @@ void SV_CheckAllEnts (void)
                if (PRVM_serveredictfloat(check, movetype) == MOVETYPE_PUSH
                 || PRVM_serveredictfloat(check, movetype) == MOVETYPE_NONE
                 || PRVM_serveredictfloat(check, movetype) == MOVETYPE_FOLLOW
-                || PRVM_serveredictfloat(check, movetype) == MOVETYPE_NOCLIP)
+                || PRVM_serveredictfloat(check, movetype) == MOVETYPE_NOCLIP
+                || PRVM_serveredictfloat(check, movetype) == MOVETYPE_FLY_WORLDONLY)
                        continue;
 
                if (SV_TestEntityPosition (check, vec3_origin))
@@ -1598,6 +1599,8 @@ static qboolean SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, q
 
        if (movetype == MOVETYPE_FLYMISSILE)
                type = MOVE_MISSILE;
+       else if (movetype == MOVETYPE_FLY_WORLDONLY)
+               type = MOVE_WORLDONLY;
        else if (solid == SOLID_TRIGGER || solid == SOLID_NOT)
                type = MOVE_NOMONSTERS; // only clip against bmodels
        else
@@ -1785,6 +1788,7 @@ void SV_PushMove (prvm_edict_t *pusher, float movetime)
                case MOVETYPE_PUSH:
                case MOVETYPE_FOLLOW:
                case MOVETYPE_NOCLIP:
+               case MOVETYPE_FLY_WORLDONLY:
                        continue;
                default:
                        break;
@@ -2286,6 +2290,8 @@ void SV_WalkMove (prvm_edict_t *ent)
                VectorSet(downmove, PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2] - 1);
                if (PRVM_serveredictfloat(ent, movetype) == MOVETYPE_FLYMISSILE)
                        type = MOVE_MISSILE;
+               else if (PRVM_serveredictfloat(ent, movetype) == MOVETYPE_FLY_WORLDONLY)
+                       type = MOVE_WORLDONLY;
                else if (PRVM_serveredictfloat(ent, solid) == SOLID_TRIGGER || PRVM_serveredictfloat(ent, solid) == SOLID_NOT)
                        type = MOVE_NOMONSTERS; // only clip against bmodels
                else
@@ -2826,6 +2832,7 @@ static void SV_Physics_Entity (prvm_edict_t *ent)
        case MOVETYPE_BOUNCEMISSILE:
        case MOVETYPE_FLYMISSILE:
        case MOVETYPE_FLY:
+       case MOVETYPE_FLY_WORLDONLY:
                // regular thinking
                if (SV_RunThink (ent))
                        SV_Physics_Toss (ent);
@@ -2998,6 +3005,7 @@ static void SV_Physics_ClientEntity(prvm_edict_t *ent)
                SV_Physics_Toss (ent);
                break;
        case MOVETYPE_FLY:
+       case MOVETYPE_FLY_WORLDONLY:
                SV_RunThink (ent);
                SV_WalkMove (ent);
                break;
index f252ade14b7e64a06718a40b5d324f6ca393a6ff..617d1e3362f303c59743330dc94f44eb24b09981 100644 (file)
@@ -74,6 +74,7 @@ const char *vm_sv_extensions =
 "DP_LITSUPPORT "
 "DP_MONSTERWALK "
 "DP_MOVETYPEBOUNCEMISSILE "
+"DP_MOVETYPEFLYWORLDONLY "
 "DP_MOVETYPEFOLLOW "
 "DP_NULL_MODEL "
 "DP_QC_ASINACOSATANATAN2TAN "