Removed pathtarget code for trigger_pushes for now

This commit is contained in:
Andrei Drexler 2002-06-06 18:08:01 +00:00
parent 8dca6af6c5
commit d7a8408b89
2 changed files with 26 additions and 14 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.22 2002/06/06 18:08:01 makro
// Removed pathtarget code for trigger_pushes for now
//
// Revision 1.21 2002/06/04 21:35:40 makro // Revision 1.21 2002/06/04 21:35:40 makro
// Updated trigger_push code // Updated trigger_push code
// //
@ -186,14 +189,17 @@ trigger_push
void trigger_push_touch (gentity_t *self, gentity_t *other, trace_t *trace ) { void trigger_push_touch (gentity_t *self, gentity_t *other, trace_t *trace ) {
if (!other || !self)
return;
if ( !other->client ) { if ( !other->client ) {
return; return;
} }
//Makro - too soon to activate ? //Makro - too soon to activate ?
if (level.time < self->s.powerups) { /*if (level.time < self->s.legsAnim) {
return; return;
} }*/
//Makro - bot only triggers //Makro - bot only triggers
if ( self->spawnflags & 1 ) { if ( self->spawnflags & 1 ) {
@ -203,18 +209,22 @@ void trigger_push_touch (gentity_t *self, gentity_t *other, trace_t *trace ) {
} }
BG_TouchJumpPad( &other->client->ps, &self->s ); BG_TouchJumpPad( &other->client->ps, &self->s );
//Makro - team up trigger_pushes //Makro - "team up" trigger_pushes
//something is broken here :/
/*
if (self->pathtarget) { if (self->pathtarget) {
gentity_t *loop = NULL; if (self->pathtarget[0]) {
for (loop = G_Find2(NULL, FOFS(classname), self->classname, FOFS(pathtarget), self->pathtarget); loop; G_Find2(loop, FOFS(classname), self->classname, FOFS(pathtarget), self->pathtarget)) { gentity_t *loop = NULL;
//Makro - delay 5 seconds before triggering another trigger_push from the same "team" for (loop = G_Find2(NULL, FOFS(classname), self->classname, FOFS(pathtarget), self->pathtarget); loop; G_Find2(loop, FOFS(classname), self->classname, FOFS(pathtarget), self->pathtarget)) {
if (self->distance) { //Makro - delay 5 seconds before triggering another trigger_push from the same "team"
loop->s.powerups = level.time + self->distance * 1000; if (self->distance) {
} else { loop->s.legsAnim = level.time + self->distance * 1000;
loop->s.powerups = level.time + 5 * 1000; } else {
loop->s.legsAnim = level.time + 5 * 1000;
}
} }
} }
} }*/
} }
@ -280,9 +290,6 @@ void SP_trigger_push( gentity_t *self ) {
//Makro - for bot-only triggers //Makro - for bot-only triggers
if ( !(self->spawnflags & 1) ) { if ( !(self->spawnflags & 1) ) {
self->r.svFlags &= ~SVF_NOCLIENT; self->r.svFlags &= ~SVF_NOCLIENT;
self->s.powerups = 0;
} else {
self->s.powerups = 1;
} }
self->s.powerups = (self->spawnflags & 1); self->s.powerups = (self->spawnflags & 1);
self->s.eType = ET_PUSH_TRIGGER; self->s.eType = ET_PUSH_TRIGGER;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.11 2002/06/06 18:08:01 makro
// Removed pathtarget code for trigger_pushes for now
//
// Revision 1.10 2002/05/23 15:55:25 makro // Revision 1.10 2002/05/23 15:55:25 makro
// Elevators // Elevators
// //
@ -189,6 +192,8 @@ gentity_t *G_Find2 (gentity_t *from, int fieldofs, const char *match, int fieldo
for (ent = G_Find(from, fieldofs, match); ent; ent = G_Find(ent, fieldofs, match)) { for (ent = G_Find(from, fieldofs, match); ent; ent = G_Find(ent, fieldofs, match)) {
char *s = *(char **) ((byte *)ent + fieldofs2); char *s = *(char **) ((byte *)ent + fieldofs2);
if (!s)
continue;
if (!Q_stricmp(s, match2)) if (!Q_stricmp(s, match2))
return ent; return ent;
} }