X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdebug.qh;h=41c5d3017eada07992e8ba6ae102827da85525d4;hb=69eda62d02bc02ff50547bad514af3f7ce487413;hp=983b073b406c8cfb93de92a31002d5dd1359fa56;hpb=ec98f5c9d50f267779fed871c9eb094a52064219;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index 983b073b4..41c5d3017 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -1,5 +1,9 @@ #pragma once +#ifdef CSQC +#include +#endif + // This includes some functions useful for debugging. // Some more bot-specific ones are in server/pathlib/debug.qc. @@ -403,7 +407,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; @@ -425,7 +429,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