diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_misc.c | 18 | ||||
-rw-r--r-- | src/game/g_mover.c | 4 | ||||
-rw-r--r-- | src/game/g_trigger.c | 21 |
3 files changed, 38 insertions, 5 deletions
diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 2cd2dd05..23a46a3b 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -235,6 +235,14 @@ void SP_misc_portal_camera( gentity_t *ent ) ====================================================================== */ +void SP_toggle_particle_system( gentity_t *self ) +{ + //toggle EF_NODRAW + self->s.eFlags ^= EF_NODRAW; + + self->nextthink = 0; +} + /* =============== SP_use_particle_system @@ -244,8 +252,13 @@ Use function for particle_system */ void SP_use_particle_system( gentity_t *self, gentity_t *other, gentity_t *activator ) { - //toggle EF_NODRAW - self->s.eFlags ^= EF_NODRAW; + SP_toggle_particle_system( self ); + + if( self->wait > 0.0f ) + { + self->think = SP_toggle_particle_system; + self->nextthink = level.time + (int)( self->wait * 1000 ); + } } /* @@ -262,6 +275,7 @@ void SP_misc_particle_system( gentity_t *self ) G_SetOrigin( self, self->s.origin ); G_SpawnString( "psName", "", &s ); + G_SpawnFloat( "wait", "0", &self->wait ); //add the particle system to the client precache list self->s.modelindex = G_ParticleSystemIndex( s ); diff --git a/src/game/g_mover.c b/src/game/g_mover.c index 8f7de418..268a25d7 100644 --- a/src/game/g_mover.c +++ b/src/game/g_mover.c @@ -1756,6 +1756,10 @@ Don't allow decent if a living player is on it */ void Touch_Plat( gentity_t *ent, gentity_t *other, trace_t *trace ) { + // DONT_WAIT + if( ent->spawnflags & 1 ) + return; + if( !other->client || other->client->ps.stats[ STAT_HEALTH ] <= 0 ) return; diff --git a/src/game/g_trigger.c b/src/game/g_trigger.c index a79c12fe..a9ecd1a3 100644 --- a/src/game/g_trigger.c +++ b/src/game/g_trigger.c @@ -290,6 +290,9 @@ void trigger_teleporter_touch( gentity_t *self, gentity_t *other, trace_t *trace { gentity_t *dest; + if( self->s.eFlags & EF_NODRAW ) + return; + if( !other->client ) return; @@ -313,8 +316,18 @@ void trigger_teleporter_touch( gentity_t *self, gentity_t *other, trace_t *trace TeleportPlayer( other, dest->s.origin, dest->s.angles ); } +/* +=============== +trigger_teleport_use +=============== +*/ +void trigger_teleporter_use( gentity_t *ent, gentity_t *other, gentity_t *activator ) +{ + ent->s.eFlags ^= EF_NODRAW; +} + -/*QUAKED trigger_teleport (.5 .5 .5) ? SPECTATOR +/*QUAKED trigger_teleport (.5 .5 .5) ? SPECTATOR SPAWN_DISABLED Allows client side prediction of teleportation events. Must point at a target_position, which will be the teleport destination. @@ -333,11 +346,13 @@ void SP_trigger_teleport( gentity_t *self ) else self->r.svFlags &= ~SVF_NOCLIENT; - // make sure the client precaches this sound - G_SoundIndex( "sound/world/jumppad.wav" ); + // SPAWN_DISABLED + if( self->spawnflags & 2 ) + self->s.eFlags |= EF_NODRAW; self->s.eType = ET_TELEPORT_TRIGGER; self->touch = trigger_teleporter_touch; + self->use = trigger_teleporter_use; trap_LinkEntity( self ); } |