X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=cl_main.c;h=40ede8fd237b48c972e2fd640314b0b4c3718305;hb=b7d92f696edebeb716e32e2179894dea483cb3ac;hp=ec4ca8b64442e207bfcb55cb01abfb05661ad9c8;hpb=221a6cb74c3a3b30b9e60247d6e42d7a6fcdebf0;p=xonotic%2Fdarkplaces.git diff --git a/cl_main.c b/cl_main.c index ec4ca8b6..40ede8fd 100644 --- a/cl_main.c +++ b/cl_main.c @@ -171,7 +171,7 @@ void CL_ClearState(void) cl.entities[i].state_current = defaultstate; } - if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) + if (IS_NEXUIZ_DERIVED(gamemode)) { VectorSet(cl.playerstandmins, -16, -16, -24); VectorSet(cl.playerstandmaxs, 16, 16, 45); @@ -1218,7 +1218,7 @@ static void CL_UpdateNetworkEntityTrail(entity_t *e) { if (e->render.effects & EF_BRIGHTFIELD) { - if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) + if (IS_NEXUIZ_DERIVED(gamemode)) trailtype = EFFECT_TR_NEXUIZPLASMA; else CL_EntityParticles(e); @@ -1445,7 +1445,7 @@ static void CL_LinkNetworkEntity(entity_t *e) { if (e->render.effects & EF_BRIGHTFIELD) { - if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC) + if (IS_NEXUIZ_DERIVED(gamemode)) trailtype = EFFECT_TR_NEXUIZPLASMA; } if (e->render.effects & EF_DIMLIGHT) @@ -1490,7 +1490,7 @@ static void CL_LinkNetworkEntity(entity_t *e) trace_t trace; matrix4x4_t tempmatrix; Matrix4x4_Transform(&e->render.matrix, muzzleflashorigin, v2); - trace = CL_TraceLine(origin, v2, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY, true, false, NULL, false, false); + trace = CL_TraceLine(origin, v2, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY, 0, collision_extendmovelength.value, true, false, NULL, false, false); Matrix4x4_Normalize(&tempmatrix, &e->render.matrix); Matrix4x4_SetOrigin(&tempmatrix, trace.endpos[0], trace.endpos[1], trace.endpos[2]); Matrix4x4_Scale(&tempmatrix, 150, 1); @@ -1586,6 +1586,10 @@ static void CL_RelinkWorld(void) CL_UpdateRenderEntity(&ent->render); r_refdef.scene.worldentity = &ent->render; r_refdef.scene.worldmodel = cl.worldmodel; + + // if the world is q2bsp, animate the textures + if (ent->render.model && ent->render.model->brush.isq2bsp) + ent->render.framegroupblend[0].frame = (int)(cl.time * 2.0f); } static void CL_RelinkStaticEntities(void) @@ -2109,7 +2113,7 @@ static void CL_Locs_AddNode(vec3_t mins, vec3_t maxs, const char *name) int namelen; if (!name) name = ""; - namelen = strlen(name); + namelen = (int)strlen(name); node = (cl_locnode_t *) Mem_Alloc(cls.levelmempool, sizeof(cl_locnode_t) + namelen + 1); VectorSet(node->mins, min(mins[0], maxs[0]), min(mins[1], maxs[1]), min(mins[2], maxs[2])); VectorSet(node->maxs, max(mins[0], maxs[0]), max(mins[1], maxs[1]), max(mins[2], maxs[2]));