]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_triggers.qc
Begin making triggers common code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_triggers.qc
index f4fb67a1bad9a5d5cbdbadd6e4df7094e421fa0c..c5fb08c965c2afa88d6f6f3aecf1d58974c333bd 100644 (file)
@@ -61,6 +61,7 @@ void SUB_UseTargets()
 //
 // print the message
 //
+       if(self)
        if(IS_PLAYER(activator) && self.message != "")
        if(IS_REAL_CLIENT(activator))
        {
@@ -203,8 +204,8 @@ void multi_use()
 
 void multi_touch()
 {
-       if (!(self.spawnflags & 2))
-               if (!other.iscreature)
+       if(!(self.spawnflags & 2))
+       if(!other.iscreature)
                        return;
 
        if(self.team)
@@ -384,7 +385,7 @@ void counter_use()
        {
                if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
                        Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COMPLETED);
-                       
+
                self.enemy = activator;
                multi_trigger ();
        }
@@ -1770,7 +1771,7 @@ void target_voicescript_next(entity pl)
                        if(pl.voicescript_index < vs.cnt)
                                i = pl.voicescript_index * 2;
                        else if(n > vs.cnt * 2)
-                               i = mod(pl.voicescript_index - vs.cnt, (n - vs.cnt * 2 - 1) / 2) * 2 + vs.cnt * 2 + 1;
+                               i = ((pl.voicescript_index - vs.cnt) % ((n - vs.cnt * 2 - 1) / 2)) * 2 + vs.cnt * 2 + 1;
                        else
                                i = -1;
 
@@ -2051,9 +2052,9 @@ string trigger_magicear_processmessage_forallears(entity source, float teamsay,
        for(ear = magicears; ear; ear = ear.enemy)
        {
                msgout = trigger_magicear_processmessage(ear, source, teamsay, privatesay, msgin);
-               if (!(ear.spawnflags & 64))
-                       if(magicear_matched)
-                               return msgout;
+               if(!(ear.spawnflags & 64))
+               if(magicear_matched)
+                       return msgout;
                msgin = msgout;
        }
        return msgin;