]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/debug.qh
Clear out .health and .armorvalue from the client side
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / debug.qh
index 7144bf3da5ed6bb4166c3cc5b3f8f4895d416a7f..ab4e6f2e950fffc5e5ce489d27e26acf004f61c1 100644 (file)
@@ -403,7 +403,7 @@ CLASS(DebugText3d, Object)
                CONSTRUCT(DebugText3d);
                this.origin = pos;
                this.message = strzone(msg);
-               this.health = align;
+               SetResourceAmount(this, RESOURCE_HEALTH, align);
                this.hit_time = time;
                this.fade_rate = fade_rate_;
                this.velocity = vel;
@@ -411,7 +411,7 @@ CLASS(DebugText3d, Object)
        }
 
        DESTRUCTOR(DebugText3d) {
-               strunzone(this.message);
+               strfree(this.message);
        }
 
        void DebugText3d_draw2d(DebugText3d this) {
@@ -425,7 +425,7 @@ CLASS(DebugText3d, Object)
 
                int size = 8;
                vector screen_pos = project_3d_to_2d(this.origin) + since_created * this.velocity;
-               float align = this.health;
+               float align = GetResourceAmount(this, RESOURCE_HEALTH);
                if (align > 0)
                        screen_pos.x -= stringwidth(this.message, true, size * '1 1 0') * min(1, align);
                if (screen_pos.z < 0) return; // behind camera
@@ -459,13 +459,13 @@ NET_HANDLE(debug_text_3d, bool is_new) {
 #define debug_text_3d_5(pos, msg, align, dur, vel) debug_text_3d_fn(pos, msg, align, dur, vel)
 
 ERASEABLE
-void debug_text_3d_fn(vector pos, string msg, float align, float duration, vector velocity) {
+void debug_text_3d_fn(vector pos, string msg, float align, float duration, vector vel) {
        WriteHeader(MSG_BROADCAST, debug_text_3d);
        WriteVector(MSG_BROADCAST, pos);
        WriteString(MSG_BROADCAST, msg);
        WriteFloat(MSG_BROADCAST, align);
        WriteFloat(MSG_BROADCAST, duration);
-       WriteVector(MSG_BROADCAST, velocity);
+       WriteVector(MSG_BROADCAST, vel);
 }
 
 #endif // SVQC