]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/superspec/sv_superspec.qc
Numerous enhancements to the new status effects system, split powerups into a dedicat...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / superspec / sv_superspec.qc
index c721f4571b58fadbaa6f895f6e389bc0a470c955..71bb9c8fcc9d7974f8b4ce3ebd6a9b6aa764550a 100644 (file)
@@ -346,7 +346,8 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand)
 
        if(cmd_name == "followpowerup")
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && (STAT(STRENGTH_FINISHED, it) > time || STAT(INVINCIBLE_FINISHED, it) > time), { return superspec_Spectate(player, it); });
+               // TODO: somehow cheaply loop through all held powerups
+               FOREACH_CLIENT(IS_PLAYER(it) && (StatusEffects_active(STATUSEFFECT_Strength, it) || StatusEffects_active(STATUSEFFECT_Shield, it)), { return superspec_Spectate(player, it); });
 
                superspec_msg("", "", player, "No active powerup\n", 1);
                return true;
@@ -354,7 +355,7 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand)
 
        if(cmd_name == "followstrength")
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && STAT(STRENGTH_FINISHED, it) > time, { return superspec_Spectate(player, it); });
+               FOREACH_CLIENT(IS_PLAYER(it) && StatusEffects_active(STATUSEFFECT_Strength, it), { return superspec_Spectate(player, it); });
 
                superspec_msg("", "", player, "No active Strength\n", 1);
                return true;
@@ -362,7 +363,7 @@ MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand)
 
        if(cmd_name == "followshield")
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && STAT(INVINCIBLE_FINISHED, it) > time, { return superspec_Spectate(player, it); });
+               FOREACH_CLIENT(IS_PLAYER(it) && StatusEffects_active(STATUSEFFECT_Shield, it), { return superspec_Spectate(player, it); });
 
                superspec_msg("", "", player, "No active Shield\n", 1);
                return true;
@@ -401,7 +402,7 @@ MUTATOR_HOOKFUNCTION(superspec, ClientConnect)
        player.superspec_flags = SSF_VERBOSE;
        player.superspec_itemfilter = "";
 
-       entity _hello = spawn();
+       entity _hello = new_pure(superspec_delayed_hello);
        _hello.enemy = player;
        setthink(_hello, superspec_hello);
        _hello.nextthink = time + 5;