]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qh
Fix warmup limit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qh
index 0976e60e581c4751a8701bf293529ca57faad2ec..634d3fb647185594e04001b18c1b1790ecf17942 100644 (file)
@@ -1,13 +1,12 @@
-#ifndef MISCFUNCTIONS_H
-#define MISCFUNCTIONS_H
+#pragma once
 
-#include "t_items.qh"
+#include <common/t_items.qh>
 
 #include "mutators/events.qh"
 
-#include "../common/constants.qh"
-#include "../common/mapinfo.qh"
-#include "../common/turrets/all.qh"
+#include <common/constants.qh>
+#include <common/mapinfo.qh>
+#include <common/turrets/all.qh>
 
 #ifdef RELEASE
 #define cvar_string_normal builtin_cvar_string
@@ -77,7 +76,7 @@ void GameLogInit();
 
 void GameLogClose();
 
-void GetCvars(float f);
+void GetCvars(entity this, float f);
 
 string GetMapname();
 
@@ -117,6 +116,8 @@ void WarpZone_crosshair_trace(entity pl);
 
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
 
+#define IS_DEAD(s) ((s).deadflag != DEAD_NO)
+
 
 #define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
 #define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))
@@ -131,13 +132,12 @@ string strcat1(string s) = #115; // FRIK_FILE
 float logfile_open;
 float logfile;
 
-#define strstr strstrofs
 /*
 // NOTE: DO NOT USE THIS FUNCTION TOO OFTEN.
 // IT WILL MOST PROBABLY DESTROY _ALL_ OTHER TEMP
 // STRINGS AND TAKE QUITE LONG. haystack and needle MUST
 // BE CONSTANT OR strzoneD!
-float strstr(string haystack, string needle, float offset)
+float strstrofs(string haystack, string needle, float offset)
 {
        float len, endpos;
        string found;
@@ -261,7 +261,7 @@ void readlevelcvars()
        sv_taunt = cvar("sv_taunt");
 
        warmup_stage = cvar("g_warmup");
-       g_warmup_limit = cvar("g_warmup_limit");
+       warmup_limit = cvar("g_warmup_limit");
        g_warmup_allguns = cvar("g_warmup_allguns");
        g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
 
@@ -339,10 +339,7 @@ void readlevelcvars()
        if (!warmup_stage)
                game_starttime = time + cvar("g_start_delay");
 
-       for(int i = WEP_FIRST; i <= WEP_LAST; ++i) {
-               Weapon w = get_weaponinfo(i);
-               w.wr_init(w);
-       }
+       FOREACH(Weapons, it != WEP_Null, LAMBDA(it.wr_init(it)));
 
        readplayerstartcvars();
 }
@@ -358,7 +355,7 @@ const float INITPRIO_SETLOCATION            = 90;
 const float INITPRIO_LINKDOORS                         = 91;
 const float INITPRIO_LAST                              = 99;
 
-.void() initialize_entity;
+.void(entity this) initialize_entity;
 .float initialize_entity_order;
 .entity initialize_entity_next;
 entity initialize_entity_first;
@@ -368,7 +365,5 @@ entity initialize_entity_first;
 
 
 float sound_allowed(float dest, entity e);
-void InitializeEntity(entity e, void() func, float order);
+void InitializeEntity(entity e, void(entity this) func, float order);
 void SetCustomizer(entity e, float() customizer, void() uncustomizer);
-
-#endif