From: dresk Date: Tue, 24 Apr 2007 20:28:42 +0000 (+0000) Subject: Added QC float .allowtouchwithowner . Setting this to true allow an entity to touch... X-Git-Tag: xonotic-v0.1.0preview~3254 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=01349d19335a49f7d474c4e233705e85c222ec31;p=xonotic%2Fdarkplaces.git Added QC float .allowtouchwithowner . Setting this to true allow an entity to touch its owner (ie. missile or grenade). Be careful where you spawn your projectiles and assign this value, as you may end up detonating the projectile immediately. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7184 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/progsvm.h b/progsvm.h index e6dcafef..c9cb69f2 100644 --- a/progsvm.h +++ b/progsvm.h @@ -124,6 +124,7 @@ typedef struct prvm_prog_fieldoffsets_s int SendEntity; // ssqc int Version; // ssqc int alpha; // ssqc / csqc + int allowtouchwithowner; int ammo_cells1; // ssqc - Dissolution of Eternity mission pack int ammo_lava_nails; // ssqc - Dissolution of Eternity mission pack int ammo_multi_rockets; // ssqc - Dissolution of Eternity mission pack diff --git a/prvm_edict.c b/prvm_edict.c index 823e6b7b..ff569970 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1299,6 +1299,7 @@ void PRVM_FindOffsets(void) // server and client qc use a lot of similar fields, so this is combined prog->fieldoffsets.SendEntity = PRVM_ED_FindFieldOffset("SendEntity"); prog->fieldoffsets.Version = PRVM_ED_FindFieldOffset("Version"); + prog->fieldoffsets.allowtouchwithowner = PRVM_ED_FindFieldOffset("allowtouchwithowner"); prog->fieldoffsets.alpha = PRVM_ED_FindFieldOffset("alpha"); prog->fieldoffsets.ammo_cells1 = PRVM_ED_FindFieldOffset("ammo_cells1"); prog->fieldoffsets.ammo_lava_nails = PRVM_ED_FindFieldOffset("ammo_lava_nails"); diff --git a/sv_main.c b/sv_main.c index f019c4df..8f4ba449 100644 --- a/sv_main.c +++ b/sv_main.c @@ -2618,6 +2618,7 @@ prvm_required_field_t reqfields[] = {ev_entity, "nodrawtoclient"}, {ev_entity, "tag_entity"}, {ev_entity, "viewmodelforclient"}, + {ev_float, "allowtouchwithowner"}, {ev_float, "alpha"}, {ev_float, "ammo_cells1"}, {ev_float, "ammo_lava_nails"}, diff --git a/sv_phys.c b/sv_phys.c index 2948f2c9..6c2d933b 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -146,6 +146,9 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const int numtouchedicts; prvm_edict_t *touchedicts[MAX_EDICTS]; + // Get Allow Touch with Owner + int nAllowTouchWithOwner = PRVM_EDICTFIELDVALUE(passedict, prog->fieldoffsets.allowtouchwithowner)->_int; + VectorCopy(start, clipstart); VectorCopy(end, clipend); VectorCopy(mins, clipmins); @@ -232,10 +235,10 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const if (passedict == touch) continue; // don't clip owned entities against owner - if (traceowner == touch) + if (!nAllowTouchWithOwner && traceowner == touch) continue; // don't clip owner against owned entities - if (passedictprog == touch->fields.server->owner) + if (!nAllowTouchWithOwner && passedictprog == touch->fields.server->owner) continue; // don't clip points against points (they can't collide) if (pointtrace && VectorCompare(touch->fields.server->mins, touch->fields.server->maxs) && (type != MOVE_MISSILE || !((int)touch->fields.server->flags & FL_MONSTER))) diff --git a/svvm_cmds.c b/svvm_cmds.c index 6a32a38a..390abfec 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -88,6 +88,7 @@ char *vm_sv_extensions = "DP_SND_STEREOWAV " "DP_SOLIDCORPSE " "DP_SPRITE32 " +"DP_SV_ALLOWTOUCHWITHOWNER " "DP_SV_BOTCLIENT " "DP_SV_CLIENTCOLORS " "DP_SV_CLIENTNAME "