Permalink
Browse files

target_logic now uses entity index number to identify triggers instea…

…d of origin.

target_logic is now reset after it is fully triggered.

git-svn-id: http://entityplus.googlecode.com/svn/trunk@10 3db1106e-3bc2-ec0d-a47d-0545f0a377c6
  • Loading branch information...
1 parent 7d0826a commit 41370c438200adfaad20356a7026aac37e620581 eraesr@gmail.com committed Mar 22, 2011
Showing with 6 additions and 5 deletions.
  1. +1 −1 code/game/g_local.h
  2. +5 −4 code/game/g_target.c
View
@@ -102,7 +102,7 @@ struct gentity_s {
float angle; // set in editor, -1 = up, -2 = down
char *target;
char *targetname;
- vec3_t *triggeredorigin1; // origin of first trigger for target_logic
+ int triggeredentity; // entity index of first trigger for target_logic
char *team;
char *targetShaderName;
char *targetShaderNewName;
View
@@ -488,15 +488,16 @@ void target_logic_use (gentity_t *self, gentity_t *other, gentity_t *activator)
return;
}
- if (self->triggeredorigin1 == NULL) {
- self->triggeredorigin1 = &other->s.origin;
+ if (self->triggeredentity == 0) {
+ self->triggeredentity = &other->s.number;
}
- else if (self->triggeredorigin1 == &other->s.origin) {
+ else if (self->triggeredentity == &other->s.number) {
if ( !(self->spawnflags & 8) ) { //spawnflags 8 will make the first trigger stay on until the target_logic is fully triggered
- self->triggeredorigin1 = NULL;
+ self->triggeredentity = 0;
}
}
else {
+ self->triggeredentity = 0; //reset target_logic
G_UseTargets (self, activator);
}
}

0 comments on commit 41370c4

Please sign in to comment.