From: Samual Date: Sat, 4 Jun 2011 00:52:44 +0000 (-0400) Subject: Some more support changes for movetype_spectator -- now all that remains is making... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1c01abad5d8208e8d2a06cd06b5a18db65d3fdee;p=xonotic%2Fdarkplaces.git Some more support changes for movetype_spectator -- now all that remains is making it use fly movement properly, and making it only collide with world --- diff --git a/sv_phys.c b/sv_phys.c index 04b0e4af..c7a3b145 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -1513,12 +1513,12 @@ 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_SPECTATOR) + type = MOVE_WORLDONLY; else if (solid == SOLID_TRIGGER || solid == SOLID_NOT) - type = MOVE_WORLDONLY; // only clip against bmodels + type = MOVE_NOMONSTERS; // only clip against bmodels else type = MOVE_NORMAL; - - Con_Printf("wtfhax: %i \n", type); *trace = SV_TraceBox(start, mins, maxs, end, type, ent, SV_GenericHitSuperContentsMask(ent)); if (trace->bmodelstartsolid && failonbmodelstartsolid) @@ -2211,12 +2211,16 @@ void SV_WalkMove (prvm_edict_t *ent) // our trace will hit that thing too) VectorSet(upmove, ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2] + 1); VectorSet(downmove, ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2] - 1); + if (ent->fields.server->movetype == MOVETYPE_FLYMISSILE) type = MOVE_MISSILE; + else if (ent->fields.server->movetype == MOVETYPE_SPECTATOR) + type = MOVE_WORLDONLY; else if (ent->fields.server->solid == SOLID_TRIGGER || ent->fields.server->solid == SOLID_NOT) - type = MOVE_WORLDONLY; // only clip against bmodels + type = MOVE_NOMONSTERS; // only clip against bmodels else type = MOVE_NORMAL; + trace = SV_TraceBox(upmove, ent->fields.server->mins, ent->fields.server->maxs, downmove, type, ent, SV_GenericHitSuperContentsMask(ent)); if(trace.fraction < 1 && trace.plane.normal[2] > 0.7) clip |= 1; // but we HAVE found a floor @@ -2748,12 +2752,12 @@ static void SV_Physics_Entity (prvm_edict_t *ent) if (SV_RunThink (ent)) SV_WalkMove (ent); break; - case MOVETYPE_SPECTATOR: case MOVETYPE_TOSS: case MOVETYPE_BOUNCE: case MOVETYPE_BOUNCEMISSILE: case MOVETYPE_FLYMISSILE: case MOVETYPE_FLY: + case MOVETYPE_SPECTATOR: // regular thinking if (SV_RunThink (ent)) SV_Physics_Toss (ent); @@ -2917,7 +2921,6 @@ static void SV_Physics_ClientEntity(prvm_edict_t *ent) if (host_client->clmovement_inputtimeout <= 0) SV_WalkMove (ent); break; - case MOVETYPE_SPECTATOR: case MOVETYPE_TOSS: case MOVETYPE_BOUNCE: case MOVETYPE_BOUNCEMISSILE: @@ -2927,6 +2930,7 @@ static void SV_Physics_ClientEntity(prvm_edict_t *ent) SV_Physics_Toss (ent); break; case MOVETYPE_FLY: + case MOVETYPE_SPECTATOR: SV_RunThink (ent); SV_WalkMove (ent); break;