ATTRIB(Pickup, m_itemid, int, 0);
#ifdef SVQC
ATTRIB(Pickup, m_mins, vector, '-16 -16 0');
- ATTRIB(Pickup, m_maxs, vector, '16 16 32');
+ ATTRIB(Pickup, m_maxs, vector, '16 16 48');
ATTRIB(Pickup, m_botvalue, int, 0);
ATTRIB(Pickup, m_itemflags, int, 0);
float generic_pickupevalfunc(entity player, entity item);
if (mt == MOVETYPE_PHYSICS || mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH) {
this.move_qcphysics = false;
}
+ if(!IL_CONTAINS(g_moveables, this))
+ IL_PUSH(g_moveables, this); // add it to the moveable entities list (even if it doesn't move!) logic: if an object never sets its movetype, we assume it never does anything notable
this.movetype = (this.move_qcphysics) ? MOVETYPE_NONE : mt;
}
#elif defined(CSQC)
if(sf & ISF_SIZE)
{
- float use_bigsize = ReadByte();
- setsize(this, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32');
+ setsize(this, '-16 -16 0', '16 16 48');
}
if(sf & ISF_STATUS) // need to read/write status first so model can handle simple, fb etc.
this.solid = SOLID_TRIGGER;
//this.flags |= FL_ITEM;
- bool use_bigsize = ReadByte();
-
this.fade_end = ReadShort();
this.fade_start = ReadShort();
if(!warpzone_warpzones_exist && this.fade_start && !autocvar_cl_items_nofade)
precache_model(this.mdl);
_setmodel(this, this.mdl);
- setsize(this, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32');
+ setsize(this, '-16 -16 0', '16 16 48');
}
if(sf & ISF_COLORMAP)
WriteAngle(MSG_ENTITY, this.angles_z);
}
- if(sf & ISF_SIZE)
- {
- Pickup p = this.itemdef;
- WriteByte(MSG_ENTITY, p.instanceOfPowerup || p.instanceOfHealth || p.instanceOfArmor);
- }
+ // sets size on the client, unused on server
+ //if(sf & ISF_SIZE)
if(sf & ISF_STATUS)
WriteByte(MSG_ENTITY, this.ItemStatus);
if(sf & ISF_MODEL)
{
- Pickup p = this.itemdef;
- WriteByte(MSG_ENTITY, p.instanceOfPowerup || p.instanceOfHealth || p.instanceOfArmor);
WriteShort(MSG_ENTITY, this.fade_end);
WriteShort(MSG_ENTITY, this.fade_start);
if(this.cnt < 0 && !failhard && this.realowner.playerid == this.playerid && !IS_DEAD(this.realowner) && !(STAT(WEAPONS, this.realowner) & WEPSET(PORTO)))
{
- setsize(this, '-16 -16 0', '16 16 32');
+ setsize(this, '-16 -16 0', '16 16 48');
setorigin(this, this.origin + trace_plane_normal);
if(move_out_of_solid(this))
{
#ifdef SVQC
+// enable to debug melee range
+//#define SHOTGUN_MELEEDEBUG
+
METHOD(Shotgun, m_spawnfunc_hookreplace, Weapon(Shotgun this, entity e))
{
if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
WarpZone_traceline_antilag(this.realowner, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ((IS_CLIENT(this.realowner)) ? ANTILAG_LATENCY(this.realowner) : 0));
// draw lightning beams for debugging
- //te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
- //te_customflash(targpos, 40, 2, '1 1 1');
+ #ifdef SHOTGUN_MELEEDEBUG
+ te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
+ te_customflash(targpos, 40, 2, '1 1 1');
+ #endif
is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
if(accuracy_isgooddamage(this.realowner, target_victim)) { accuracy_add(this.realowner, WEP_SHOTGUN, 0, swing_damage); }
// draw large red flash for debugging
- //te_customflash(targpos, 200, 2, '15 0 0');
+ #ifdef SHOTGUN_MELEEDEBUG
+ te_customflash(targpos, 200, 2, '15 0 0');
+ #endif
if(WEP_CVAR_SEC(shotgun, melee_multihit)) // allow multiple hits with one swing, but not against the same player twice.
{
#pragma once
+IntrusiveList g_events;
+IntrusiveList g_components;
+STATIC_INIT(components) { g_events = IL_NEW(); g_components = IL_NEW(); }
+
/** Components always interpolate from the previous state */
#define COMPONENT(com) \
void com_##com##_interpolate(entity it, float a); \
.bool com_##com
-#define FOREACH_COMPONENT(com, body) FOREACH_ENTITY_FLOAT(com_##com, true, body)
+#define FOREACH_COMPONENT(com, body) IL_EACH(g_components, it.com_##com, body)
#define EVENT(T, args) .bool evt_##T##_listener; .void args evt_##T
#define emit(T, ...) \
MACRO_BEGIN \
- FOREACH_ENTITY_FLOAT_ORDERED(evt_##T##_listener, true, it.evt_##T(__VA_ARGS__)); \
+ IL_EACH(g_events, it.evt_##T##_listener, it.evt_##T(__VA_ARGS__)); \
MACRO_END
#define subscribe(listener, T, fn) \
MACRO_BEGIN \
listener.evt_##T = (fn); \
listener.evt_##T##_listener = true; \
+ IL_PUSH(g_events, listener); \
MACRO_END
setproperty(VF_ANGLES, view_angles);
}
-bool autocvar_cl_useenginerefdef = true;
+bool autocvar_cl_useenginerefdef = false;
/** Called once per CSQC_UpdateView() */
void CSQCPlayer_SetCamera()
IntrusiveList g_saved_team;
IntrusiveList g_monster_targets;
IntrusiveList g_pathlib_nodes;
+IntrusiveList g_moveables;
STATIC_INIT(defs)
{
g_monsters = IL_NEW();
g_saved_team = IL_NEW();
g_monster_targets = IL_NEW();
g_pathlib_nodes = IL_NEW();
+ g_moveables = IL_NEW();
}
if(autocvar_sv_freezenonclients)
return;
- FOREACH_ENTITY_FLOAT(pure_data, false,
+ IL_EACH(g_moveables, true,
{
if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH || it.move_movetype == MOVETYPE_PHYSICS)
continue;
if(autocvar_sv_gameplayfix_delayprojectiles >= 0)
return;
- FOREACH_ENTITY_FLOAT(move_qcphysics, true,
+ IL_EACH(g_moveables, it.move_qcphysics,
{
if(IS_CLIENT(it) || is_pure(it) || it.classname == "" || it.move_movetype == MOVETYPE_NONE)
continue;