X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fsecret.qc;h=9377332e2fb138299e1f3af53b653d57e55163d6;hb=95a5a2479a35e264473e8ba3fc4e584553da42b3;hp=9260c01ac2817e1f6920139f1f7b9c1c42895056;hpb=cff3504ad5e8ace014ea44de7ad04ad6e246a277;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/secret.qc b/qcsrc/common/triggers/trigger/secret.qc index 9260c01ac..9377332e2 100644 --- a/qcsrc/common/triggers/trigger/secret.qc +++ b/qcsrc/common/triggers/trigger/secret.qc @@ -1,17 +1,18 @@ +#include "secret.qh" #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) #include #include - #include "secret.qh" #endif #ifdef SVQC void secrets_setstatus(entity this) { - this.stat_secrets_total = secrets_total; - this.stat_secrets_found = secrets_found; + // TODO: use global stats! + STAT(SECRETS_TOTAL, this) = secrets_total; + STAT(SECRETS_FOUND, this) = secrets_found; } /** @@ -34,7 +35,9 @@ void trigger_secret_touch(entity this, entity toucher) // handle normal trigger features multi_touch(this, toucher); - delete(this); + // we can't just delete(this) here, because this is a touch function + // called while C code is looping through area links... + //delete(this); } /*QUAKED trigger_secret (.5 .5 .5) ? @@ -76,7 +79,7 @@ spawnfunc(trigger_secret) this.delay = 0; // convert this trigger to trigger_once - this.classname = "trigger_once"; + //this.classname = "trigger_once"; spawnfunc_trigger_once(this); // take over the touch() function, so we can mark secret as found