]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/minigames/cl_minigames.qc
Replace print calls with logger calls
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / minigames / cl_minigames.qc
index 0bac54c67863df0689c02310f485cdc51cfb4dbe..3a1cc86744c16f9ea93f40c0a3ce22801cd874d6 100644 (file)
@@ -95,7 +95,7 @@ MINIGAME_SIMPLELINKED_ENTITIES
 
 void minigame_autoclean_entity(entity e)
 {
-       dprint("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+       LOG_TRACE("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
        remove(e);
 }
 
@@ -105,6 +105,7 @@ void deactivate_minigame()
 {
        if ( !active_minigame )
                return;
+
        active_minigame.minigame_event(active_minigame,"deactivate");
        entity e = world;
        while( (e = findentity(e, owner, active_minigame)) )
@@ -141,7 +142,7 @@ void activate_minigame(entity minigame)
        
        if ( !minigame.descriptor || minigame.classname != "minigame" )
        {
-               dprint("Trying to activate unregistered minigame ",minigame.netname," in client\n");
+               LOG_TRACE("Trying to activate unregistered minigame ",minigame.netname," in client\n");
                return;
        }
        
@@ -177,7 +178,6 @@ vector ReadVector2D() { vector v; v_x = ReadCoord(); v_y = ReadCoord(); v_z = 0;
 vector ReadVector() { vector v; v_x = ReadCoord(); v_y = ReadCoord(); v_z = ReadCoord(); return v; }
 string() ReadString_Raw = #366;
 string ReadString_Zoned() { return strzone(ReadString_Raw()); }
-#define ReadFloat ReadCoord
 #define ReadString ReadString_Zoned
 #define FIELD(Flags, Type,Name) if ( sf & (Flags) ) self.Name = Read##Type();
 #define MSLE(Name,Fields) \
@@ -197,7 +197,7 @@ void minigame_read_owner()
                self.owner = find(self.owner,netname,owner_name);
        while ( self.owner && self.owner.classname != "minigame" );
        if ( !self.owner )
-               dprint("Got a minigame entity without a minigame!\n");
+               LOG_TRACE("Got a minigame entity without a minigame!\n");
 }
 void ent_read_minigame()
 {
@@ -219,7 +219,7 @@ void ent_read_minigame()
                        self.entremove = minigame_entremove;
                        self.descriptor = minigame_get_descriptor(ReadString_Raw());
                        if ( !self.descriptor )
-                               dprint("Got a minigame without a client-side descriptor!\n");
+                               LOG_TRACE("Got a minigame without a client-side descriptor!\n");
                        else
                                self.minigame_event = self.descriptor.minigame_event;
                }
@@ -235,7 +235,7 @@ void ent_read_minigame()
                        minigame_read_owner();
                        float ent = ReadLong();
                        self.minigame_playerslot = ent;
-                       dprint("Player: ",GetPlayerName(ent-1),"\n");
+                       LOG_TRACE("Player: ",GetPlayerName(ent-1),"\n");
                        
                        activate = (ent == player_localnum+1 && self.owner && self.owner != active_minigame);
                        
@@ -255,15 +255,14 @@ void ent_read_minigame()
        
        if ( minigame_ent )
                minigame_ent.minigame_event(minigame_ent,"network_receive",self,sf);
-       
+
        if ( sf & MINIG_SF_CREATE )
        {
-               dprint("CL Reading entity: ",ftos(num_for_edict(self)),
+               LOG_TRACE("CL Reading entity: ",ftos(num_for_edict(self)),
                        " classname:",self.classname," enttype:",ftos(self.enttype) );
-               dprint(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
+               LOG_TRACE(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
        }
 }
-#undef ReadFloat
 #undef ReadString
 #undef FIELD
 #undef MSLE
@@ -287,7 +286,7 @@ string minigame_getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_
        
        if ( take_until > strlen(s) )
                take_until = strlen(s);
-       
+
        for ( int i = 0; i < take_until; i++ )
                if ( substring(s,i,1) == "\n" )
                {
@@ -404,4 +403,4 @@ void minigame_prompt()
                HUD_Notify_Push(sprintf("minigames/%s/icon_notif",active_minigame.descriptor.netname),
                        _("It's your turn"), "");
        }
-}
\ No newline at end of file
+}