myblastorigin = WarpZone_TransformOrigin(targ, blastorigin);
// if it's a player, use the view origin as reference
- if (targ.classname == "player")
- center = targ.origin + targ.view_ofs;
- else
- center = targ.origin + (targ.mins + targ.maxs) * 0.5;
+ center = CENTER_OR_VIEWOFS(targ);
force = normalize(center - myblastorigin);
force = force * (finaldmg / coredamage) * forceintensity;
#define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(v.classname == STR_PLAYER)
#endif
+#define CENTER_OR_VIEWOFS(ent) (ent.origin + ((ent.classname == STR_PLAYER) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
+
// copies a string to a tempstring (so one can strunzone it)
string strcat1(string s) = #115; // FRIK_FILE
if(!head.speedrunning && !head.vehicle)
{
// if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
- vector head_center = WarpZone_UnTransformOrigin(head, PLAYER_CENTER(head));
- vector passer_center = PLAYER_CENTER(player);
+ vector head_center = WarpZone_UnTransformOrigin(head, CENTER_OR_VIEWOFS(head));
+ vector passer_center = CENTER_OR_VIEWOFS(player);
if(ctf_CheckPassDirection(head_center, passer_center, player.v_angle, head.WarpZone_findradius_nearest))
{
{
if(closest_target)
{
- vector closest_target_center = WarpZone_UnTransformOrigin(closest_target, PLAYER_CENTER(closest_target));
+ vector closest_target_center = WarpZone_UnTransformOrigin(closest_target, CENTER_OR_VIEWOFS(closest_target));
if(vlen(passer_center - head_center) < vlen(passer_center - closest_target_center))
{ closest_target = head; }
}
.float max_flag_health;
.float next_take_time;
-// passing properties
+// passing/throwing properties
.float pass_distance;
.entity pass_sender;
.entity pass_target;
.float throw_prevtime;
.float throw_count;
-// passing macros
-#define PLAYER_CENTER(ent) (ent.origin + ((ent.classname == "player") ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
-
// CaptureShield: If the player is too bad to be allowed to capture, shield them from taking the flag.
.float ctf_captureshielded; // set to 1 if the player is too bad to be allowed to capture
float ctf_captureshield_min_negscore; // punish at -20 points