]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/effectinfo.qc
ATTRIB: overload default value, require semicolon
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / effectinfo.qc
index da98946021b611dfc731f597b57ab60832c70249..cf6d5fca9395a29b8985a1e059522bd1a5f8206e 100644 (file)
     /**/
 
 CLASS(EffectInfo, Object)
-    ATTRIB(EffectInfo, effectinfo_name, string, string_null)
+    ATTRIB(EffectInfo, effectinfo_name, string);
     CONSTRUCTOR(EffectInfo, string s) {
         CONSTRUCT(EffectInfo);
         this.effectinfo_name = s;
@@ -193,11 +193,13 @@ CLASS(EffectInfo, Object)
     MY(velocityoffset, vector, '0 0 0') \
     /**/
 
-    #define MY(f, type, val) ATTRIB(EffectInfo, effectinfo_##f, type, val)
+    #define MY(f, type, val) ATTRIB(EffectInfo, effectinfo_##f, type, val);
     FIELDS(MY)
     #undef MY
 
-    METHOD(EffectInfo, describe, string(EffectInfo this)) {
+    METHOD(EffectInfo, describe, string(EffectInfo this))
+    {
+        TC(EffectInfo, this);
         string s = sprintf("SUB(%s) {\n", this.effectinfo_name);
         #define str_bool(it) (it ? "true" : "false")
         #define str_float(it) ftos(it)
@@ -209,7 +211,9 @@ CLASS(EffectInfo, Object)
         return strcat(s, "}\n");
     }
 
-    METHOD(EffectInfo, dump, string(EffectInfo this)) {
+    METHOD(EffectInfo, dump, string(EffectInfo this))
+    {
+        TC(EffectInfo, this);
         string s = sprintf("effect %s\n", this.effectinfo_name);
         #define MY(f) this.effectinfo_##f
         #define p(k, isset, parse, unparse) if (isset) { s = strcat(s, "\t", #k, unparse, "\n"); }
@@ -223,8 +227,8 @@ CLASS(EffectInfo, Object)
 ENDCLASS(EffectInfo)
 
 CLASS(EffectInfoGroup, Object)
-    ATTRIBARRAY(EffectInfoGroup, children, EffectInfo, 16)
-    ATTRIB(EffectInfoGroup, children_count, int, 0)
+    ATTRIBARRAY(EffectInfoGroup, children, EffectInfo, 16);
+    ATTRIB(EffectInfoGroup, children_count, int, 0);
 ENDCLASS(EffectInfoGroup)
 
 void effectinfo_read()
@@ -249,7 +253,7 @@ void effectinfo_read()
             #undef p
             #undef MY
             default:
-                LOG_WARNINGF("Unknown property '%s'\n", k);
+                LOG_WARNF("Unknown property '%s'", k);
                 break;
         }
     }
@@ -302,7 +306,7 @@ GENERIC_COMMAND(dumpeffectinfo, "Dump all effectinfo to effectinfo_dump.txt")
                                LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.\n", filename);
                 fclose(fh);
             } else {
-                LOG_WARNINGF("Could not open file '%s'!\n", filename);
+                LOG_WARNF("Could not open file '%s'!", filename);
             }
             return;
         }