From 223b851b7ba8fc052eb16a830d3a79b994857884 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Fri, 6 Nov 2009 12:02:02 +0000 Subject: [PATCH] Commit two patches from SmokingGuns's Tequila, fixing problems with very fast movers and a typo in the string drawing function. (#4329) and (#4330) --- code/cgame/cg_drawtools.c | 2 +- code/game/g_mover.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/code/cgame/cg_drawtools.c b/code/cgame/cg_drawtools.c index 2651d98d..df4188fe 100644 --- a/code/cgame/cg_drawtools.c +++ b/code/cgame/cg_drawtools.c @@ -714,7 +714,7 @@ static void UI_DrawProportionalString2( int x, int y, const char* str, vec4_t co trap_R_SetColor( color ); ax = x * cgs.screenXScale + cgs.screenXBias; - ay = y * cgs.screenXScale; + ay = y * cgs.screenYScale; s = str; while ( *s ) diff --git a/code/game/g_mover.c b/code/game/g_mover.c index d2c76f4b..63bd54be 100644 --- a/code/game/g_mover.c +++ b/code/game/g_mover.c @@ -1308,6 +1308,25 @@ void Reached_Train( gentity_t *ent ) { ent->s.pos.trDuration = length * 1000 / speed; + // Tequila comment: Be sure to send to clients after any fast move case + ent->r.svFlags &= ~SVF_NOCLIENT; + + // Tequila comment: Fast move case + if(ent->s.pos.trDuration<1) { + // Tequila comment: As trDuration is used later in a division, we need to avoid that case now + // With null trDuration, + // the calculated rocks bounding box becomes infinite and the engine think for a short time + // any entity is riding that mover but not the world entity... In rare case, I found it + // can also stuck every map entities after func_door are used. + // The desired effect with very very big speed is to have instant move, so any not null duration + // lower than a frame duration should be sufficient. + // Afaik, the negative case don't have to be supported. + ent->s.pos.trDuration=1; + + // Tequila comment: Don't send entity to clients so it becomes really invisible + ent->r.svFlags |= SVF_NOCLIENT; + } + // looping sound ent->s.loopSound = next->soundLoop;