float f, i, j;
vector v;
if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) &&
- spectatee_status != -1 && !csqcplayer.viewloc && !MUTATOR_CALLHOOK(DrawCrosshair) &&
+ spectatee_status != -1 && (!csqcplayer.viewloc || (!spectatee_status && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))) && !MUTATOR_CALLHOOK(DrawCrosshair) &&
!HUD_MinigameMenu_IsOpened() )
{
if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
float shottype;
// wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
- wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
+ if(csqcplayer.viewloc && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))
+ wcross_origin = viewloc_mousepos;
+ else
+ wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
wcross_origin.z = 0;
if(autocvar_crosshair_hittest)
{
viewloc_mousepos.x = bound(0, viewloc_mousepos.x, vid_conwidth);
viewloc_mousepos.y = bound(0, viewloc_mousepos.y, vid_conheight);
- float cursor_alpha = 1 - autocvar__menu_alpha;
- draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
+ //float cursor_alpha = 1 - autocvar__menu_alpha;
+ //draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
}
bool ov_enabled;
{
entity e = new(item_vaporizer_cells);
setorigin(e, item.origin);
- e.noalign = item.noalign;
+ e.noalign = Item_ShouldKeepPosition(item);
e.cnt = item.cnt;
e.team = item.team;
e.spawnfunc_checked = true;
}
}
- float n = 0;
+ int n = 0;
entity o = NULL;
if(player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout)
n = -1;
- else
+ else if(STAT(FROZEN, player) == 3)
{
vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
n = 0;
FOREACH_CLIENT(IS_PLAYER(it) && it != player, {
- if(!IS_DEAD(it))
- if(STAT(FROZEN, it) == 0)
- if(SAME_TEAM(it, player))
+ if(!IS_DEAD(it) && STAT(FROZEN, it) == 0 && SAME_TEAM(it, player))
if(boxesoverlap(player.absmin - revive_extra_size, player.absmax + revive_extra_size, it.absmin, it.absmax))
{
if(!o)
o = it;
- if(STAT(FROZEN, player) == 1)
- it.reviving = true;
+ it.reviving = true;
++n;
}
});
}
- if(n && STAT(FROZEN, player) == 3) // OK, there is at least one teammate reviving us
+ if(n > 0 && STAT(FROZEN, player) == 3) // OK, there is at least one teammate reviving us
{
player.revive_progress = bound(0, player.revive_progress + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
SetResourceAmount(player, RESOURCE_HEALTH, max(1, player.revive_progress * start_health));
}
}
-void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); }
-void self_spawnfunc_weapon_rpc(entity this) { spawnfunc_weapon_rpc(this); }
-
-MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn)
-{
- entity ent = M_ARGV(0, entity);
-
- if(autocvar_g_powerups)
- if(autocvar_g_overkill_powerups_replace)
- {
- if(ent.classname == "item_strength")
- {
- entity wep = new(weapon_hmg);
- setorigin(wep, ent.origin);
- setmodel(wep, MDL_OK_HMG);
- wep.ok_item = true;
- wep.noalign = Item_ShouldKeepPosition(ent);
- wep.cnt = ent.cnt;
- wep.team = ent.team;
- wep.respawntime = g_pickup_respawntime_superweapon;
- wep.pickup_anyway = true;
- wep.spawnfunc_checked = true;
- setthink(wep, self_spawnfunc_weapon_hmg);
- wep.nextthink = time + 0.1;
- return true;
- }
- else if(ent.classname == "item_shield")
- {
- entity wep = new(weapon_rpc);
- setorigin(wep, ent.origin);
- setmodel(wep, MDL_OK_RPC);
- wep.ok_item = true;
- wep.noalign = Item_ShouldKeepPosition(ent);
- wep.cnt = ent.cnt;
- wep.team = ent.team;
- wep.respawntime = g_pickup_respawntime_superweapon;
- wep.pickup_anyway = true;
- wep.spawnfunc_checked = true;
- setthink(wep, self_spawnfunc_weapon_rpc);
- wep.nextthink = time + 0.1;
- return true;
- }
- }
-}
-
bool ok_HandleItemWaypoints(entity e)
{
if(!autocvar_g_overkill_itemwaypoints)
{
entity item = M_ARGV(0, entity);
- if(item.ok_item)
+ if (item.ok_item)
+ {
return false;
-
+ }
+ if (!autocvar_g_powerups || !autocvar_g_overkill_powerups_replace)
+ {
+ return true;
+ }
+ if (item.classname == "item_strength")
+ {
+ entity wep = new(weapon_hmg);
+ setorigin(wep, item.origin);
+ wep.ok_item = true;
+ wep.noalign = Item_ShouldKeepPosition(item);
+ wep.cnt = item.cnt;
+ wep.team = item.team;
+ wep.respawntime = g_pickup_respawntime_superweapon;
+ wep.pickup_anyway = true;
+ wep.spawnfunc_checked = true;
+ Item_Initialize(wep, "weapon_hmg");
+ return true;
+ }
+ else if (item.classname == "item_shield")
+ {
+ entity wep = new(weapon_rpc);
+ setorigin(wep, item.origin);
+ wep.ok_item = true;
+ wep.noalign = Item_ShouldKeepPosition(item);
+ wep.cnt = item.cnt;
+ wep.team = item.team;
+ wep.respawntime = g_pickup_respawntime_superweapon;
+ wep.pickup_anyway = true;
+ wep.spawnfunc_checked = true;
+ Item_Initialize(wep, "weapon_rpc");
+ return true;
+ }
return true;
}
if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
return cvar(s);
}
- if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default)
+ if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default && autocvar_g_physics_clientselect_default != "")
{
string s = strcat("g_physics_", autocvar_g_physics_clientselect_default, "_", option);
if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
#ifdef CSQC
bool autocvar_cl_ghost_items_vehicle = true;
.vector item_glowmod;
+.bool item_simple; // probably not really needed, but better safe than sorry
void Item_SetAlpha(entity this)
{
bool veh_hud = (hud && autocvar_cl_ghost_items_vehicle);
{
if(this.ItemStatus & ITS_ANIMATE1)
{
- this.angles += this.avelocity * frametime;
+ if(!this.item_simple)
+ this.angles += this.avelocity * frametime;
float fade_in = bound(0, time - this.onground_time, 1);
setorigin(this, this.oldorigin + fade_in * ('0 0 10' + '0 0 8' * sin((time - this.onground_time) * 2)));
}
if(this.ItemStatus & ITS_ANIMATE2)
{
- this.angles += this.avelocity * frametime;
+ if(!this.item_simple)
+ this.angles += this.avelocity * frametime;
float fade_in = bound(0, time - this.onground_time, 1);
setorigin(this, this.oldorigin + fade_in * ('0 0 8' + '0 0 4' * sin((time - this.onground_time) * 3)));
}
Item_SetAlpha(this);
}
-void ItemDrawSimple(entity this)
-{
- if(this.gravity)
- {
- Movetype_Physics_MatchServer(this, false);
-
- if(IS_ONGROUND(this))
- this.gravity = 0;
- }
-
- Item_SetAlpha(this);
-}
-
void Item_PreDraw(entity this)
{
if(warpzone_warpzones_exist)
this.mdl = "";
string _fn = ReadString();
+ this.item_simple = false; // reset it!
if(autocvar_cl_simple_items && (this.ItemStatus & ITS_ALLOWSI))
{
string _fn2 = substring(_fn, 0 , strlen(_fn) -4);
- this.draw = ItemDrawSimple;
+ this.item_simple = true;
if(fexists(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".md3")))
this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".md3"));
this.mdl = strzone(strcat(_fn2, autocvar_cl_simpleitems_postfix, ".mdl"));
else
{
- this.draw = ItemDraw;
+ this.item_simple = false;
LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it");
}
}
- if(this.draw != ItemDrawSimple)
+ if(!this.item_simple)
this.mdl = strzone(_fn);
.vector colormod;
void ItemDraw(entity this);
-void ItemDrawSimple(entity this);
#endif
#ifdef SVQC
} else {
vector mpos = CursorToWorldCoord(viewloc_mousepos);
mpos.x = view.origin.x; // replace the cursor's x position with the player's
- view_angle = aim_vec(view.origin, mpos); // get new angles
+ view_angle = aim_vec(view.origin + view.view_ofs, mpos); // get new angles
}
view.angles_y = view_angle.y;
setproperty(VF_CL_VIEWANGLES, view_angle);
/* spawnfunc */ ATTRIB(Crylink, m_canonical_spawnfunc, string, "weapon_crylink");
/* ammotype */ ATTRIB(Crylink, ammo_type, int, RESOURCE_CELLS);
/* impulse */ ATTRIB(Crylink, impulse, int, 6);
-/* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB | WEP_FLAG_NODUAL);
+/* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB);
/* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000);
/* color */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1');
/* modelname */ ATTRIB(Crylink, mdl, string, "crylink");