+ if(this.active != ACTIVE_ACTIVE)
+ return;
+
+ entity store = this;
+ if(this.spawnflags & COUNTER_PER_PLAYER)
+ {
+ if(!IS_PLAYER(actor))
+ return;
+ entity mycounter = NULL;
+ IL_EACH(g_counters, it.realowner == actor && it.owner == this,
+ {
+ mycounter = it;
+ break;
+ });
+ if(!mycounter)
+ {
+ mycounter = new_pure(counter);
+ IL_PUSH(g_counters, mycounter);
+ mycounter.owner = this;
+ mycounter.realowner = actor;
+ mycounter.reset = counter_reset; // NOTE: this may be useless as the player deletes their counters upon respawning
+ mycounter.counter_cnt = 0;
+ }
+ store = mycounter;
+ }
+
+ store.counter_cnt += 1;
+ if (store.counter_cnt > this.count)