#include "../common/playerstats.qh"
#include "../common/teams.qh"
#include "../common/triggers/subs.qh"
-#include "../common/urllib.qh"
#include "../common/util.qh"
#include "../common/turrets/sv_turrets.qh"
#include "../common/weapons/all.qh"
{
if (DistributeEvenly_amount)
{
- dprint("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ");
- dprint(ftos(DistributeEvenly_totalweight), " left!)\n");
+ LOG_TRACE("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ");
+ LOG_TRACE(ftos(DistributeEvenly_totalweight), " left!)\n");
}
if (totalweight == 0)
DistributeEvenly_amount = 0;
}
if (autocvar_sv_eventlog_console)
{
- print(s, "\n");
+ LOG_INFO(s, "\n");
}
}
{
if (i != 0)
{
- dprint("Nearest point (");
- dprint(nearest_entity[0].netname);
- dprint(") is not visible, using a visible one.\n");
+ LOG_TRACE("Nearest point (");
+ LOG_TRACE(nearest_entity[0].netname);
+ LOG_TRACE(") is not visible, using a visible one.\n");
}
return nearest_entity[i];
}
if (num_nearest == 0)
return world;
- dprint("Not seeing any location point, using nearest as fallback.\n");
+ LOG_TRACE("Not seeing any location point, using nearest as fallback.\n");
/* DEBUGGING CODE:
dprint("Candidates were: ");
for(j = 0; j < num_nearest; ++j)
case "S": replacement = ftos(vlen(self.velocity)); break;
default:
{
- MUTATOR_CALLHOOK(FormatMessage, escape, replacement);
+ MUTATOR_CALLHOOK(FormatMessage, escape, replacement, msg);
+ escape = format_escape;
+ replacement = format_replacement;
break;
}
}
return msg;
}
-float boolean(float value) { // if value is 0 return false (0), otherwise return true (1)
- return (value == 0) ? false : true;
-}
-
/*
=============
GetCvars
}
if (j > WEP_LAST)
{
- print("The weapon mutator list contains an unknown weapon ", s, ". Skipped.\n");
+ LOG_INFO("The weapon mutator list contains an unknown weapon ", s, ". Skipped.\n");
}
}
g_weaponarena_list = strzone(substring(g_weaponarena_list, 0, strlen(g_weaponarena_list) - 3));
if(trace_dphitcontents == 0)
{
//dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n");
- dprintf("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin));
+ LOG_TRACEF("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin));
checkclient();
}
if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
traceline(self.origin - tic, self.origin + tic, MOVE_NORMAL, self);
if (trace_fraction >= 1)
{
- dprint("Odd... did not hit...?\n");
+ LOG_TRACE("Odd... did not hit...?\n");
}
else if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
{
- dprint("Detected and prevented the sky-grapple bug.\n");
+ LOG_TRACE("Detected and prevented the sky-grapple bug.\n");
return 1;
}
}
}
else
{
- print("Received HTTP request data for an invalid id ", ftos(id), ".\n");
+ LOG_INFO("Received HTTP request data for an invalid id ", ftos(id), ".\n");
}
}
{
setorigin(e, start);
e.angles = vectoangles(end - start);
- dprint("Needed ", ftos(i + 1), " attempts\n");
+ LOG_TRACE("Needed ", ftos(i + 1), " attempts\n");
return true;
}
else
{
while(iter > 0)
{
- print(ftos(randombit(bits)), "\n");
+ LOG_INFO(ftos(randombit(bits)), "\n");
--iter;
}
}
}
-void defer_think()
-{
- entity oself;
-
- oself = self;
- self = self.owner;
- oself.think = SUB_Remove;
- oself.nextthink = time;
-
- oself.use();
-}
-
-/*
- Execute func() after time + fdelay.
- self when func is executed = self when defer is called
-*/
-void defer(float fdelay, void() func)
-{
- entity e;
-
- e = spawn();
- e.owner = self;
- e.use = func;
- e.think = defer_think;
- e.nextthink = time + fdelay;
-}
-
.string aiment_classname;
.float aiment_deadflag;
void SetMovetypeFollow(entity ent, entity e)
float isPushable(entity e)
{
- if(e.iscreature)
- return true;
if(e.pushable)
return true;
+ if(IS_VEHICLE(e))
+ return false;
+ if(e.iscreature)
+ return true;
switch(e.classname)
{
case "body":