From d745121f8d73e0c9f65cd6b2b5806f9ba54de93d Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Mon, 14 Jul 2014 01:40:32 +0200 Subject: fix mover placement bugs resulting in from the stupid use of InitMover() --- src/game/g_mover.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/game') diff --git a/src/game/g_mover.c b/src/game/g_mover.c index 81284460..d0620118 100644 --- a/src/game/g_mover.c +++ b/src/game/g_mover.c @@ -2389,8 +2389,12 @@ A bmodel that just sits there, doing nothing. Can be used for conditional walls */ void SP_func_static( gentity_t *ent ) { + vec3_t savedOrigin; trap_SetBrushModel( ent, ent->model ); + VectorCopy( ent->r.currentOrigin, savedOrigin ); InitMover( ent ); + VectorCopy( savedOrigin, ent->r.currentOrigin ); + VectorCopy( savedOrigin, ent->s.pos.trBase ); } @@ -2416,6 +2420,8 @@ check either the X_AXIS or Y_AXIS box to change that. */ void SP_func_rotating( gentity_t *ent ) { + vec3_t savedOrigin; + if( !ent->speed ) ent->speed = 100; @@ -2433,7 +2439,10 @@ void SP_func_rotating( gentity_t *ent ) ent->damage = 2; trap_SetBrushModel( ent, ent->model ); + VectorCopy( ent->r.currentOrigin, savedOrigin ); InitMover( ent ); + VectorCopy( savedOrigin, ent->r.currentOrigin ); + VectorCopy( savedOrigin, ent->s.pos.trBase ); trap_LinkEntity( ent ); } @@ -2462,6 +2471,7 @@ void SP_func_bobbing( gentity_t *ent ) { float height; float phase; + vec3_t savedOrigin; G_SpawnFloat( "speed", "4", &ent->speed ); G_SpawnFloat( "height", "32", &height ); @@ -2469,7 +2479,10 @@ void SP_func_bobbing( gentity_t *ent ) G_SpawnFloat( "phase", "0", &phase ); trap_SetBrushModel( ent, ent->model ); + VectorCopy( ent->r.currentOrigin, savedOrigin ); InitMover( ent ); + VectorCopy( savedOrigin, ent->r.currentOrigin ); + VectorCopy( savedOrigin, ent->s.pos.trBase ); ent->s.pos.trDuration = ent->speed * 1000; ent->s.pos.trTime = ent->s.pos.trDuration * phase; @@ -2510,6 +2523,7 @@ void SP_func_pendulum( gentity_t *ent ) float length; float phase; float speed; + vec3_t savedOrigin; G_SpawnFloat( "speed", "30", &speed ); G_SpawnInt( "dmg", "2", &ent->damage ); @@ -2527,7 +2541,10 @@ void SP_func_pendulum( gentity_t *ent ) ent->s.pos.trDuration = ( 1000 / freq ); + VectorCopy( ent->r.currentOrigin, savedOrigin ); InitMover( ent ); + VectorCopy( savedOrigin, ent->r.currentOrigin ); + VectorCopy( savedOrigin, ent->s.pos.trBase ); ent->s.apos.trDuration = 1000 / freq; ent->s.apos.trTime = ent->s.apos.trDuration * phase; -- cgit