-#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
void GameLogClose();
-void GetCvars(float f);
+void GetCvars(entity this, float f);
string GetMapname();
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))
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;
sv_taunt = cvar("sv_taunt");
warmup_stage = cvar("g_warmup");
- g_warmup_limit = cvar("g_warmup_limit");
+ warmup_limit = cvar("g_warmup_limit");
+ if(warmup_limit == 0)
+ warmup_limit = (autocvar_timelimit > 0) ? autocvar_timelimit * 60 : autocvar_timelimit;
g_warmup_allguns = cvar("g_warmup_allguns");
g_warmup_allow_timeout = cvar("g_warmup_allow_timeout");
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();
}
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;
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