It wasn't clear at call sites that this had been changed to a delayed
function (in SVQC only), and that the return value was no longer
available. We can just use different names for the QC implementation,
with different names for delayed and direct calls, and leave the
original name for calling the builtin if required. The builtin's wrapper
macro for changing the self global to a parameter is retained and it now
works the same in SVQC and CSQC.
Removes another case of
cc83c39c27ea0757cf169562428e443c5ab60fdc
else // drop to floor, automatically find a platform and set that as spawn origin
{
flag.noalign = false;
- droptofloor(flag);
+ DropToFloor_QC_DelayedInit(flag);
set_movetype(flag, MOVETYPE_NONE);
}
this.flags = FL_ITEM;
setsize(this, '-48 -48 -32', '48 48 32'); // 0.8.6 used '-32 -32 -32', '32 32 32' with sv_legacy_bbox_expand 1 and FL_ITEM
setorigin(this, this.origin + '0 0 20');
- droptofloor(this);
+ DropToFloor_QC_DelayedInit(this);
waypoint_spawnforitem(this);
WaypointSprite_SpawnFixed(WP_DomNeut, this.origin + '0 0 32', this, sprite, RADARICON_DOMPOINT);
{
setorigin(cp, cp.origin + '0 0 20');
cp.noalign = false;
- droptofloor(cp);
+ DropToFloor_QC_DelayedInit(cp);
set_movetype(cp, MOVETYPE_TOSS);
}
gen.colormap = 1024 + (teamnum - 1) * 17;
// generator placement
- droptofloor(gen);
+ DropToFloor_QC_DelayedInit(gen);
// waypointsprites
WaypointSprite_SpawnFixed(WP_Null, gen.origin + CPGEN_WAYPOINT_OFFSET, gen, sprite, RADARICON_NONE);
// NOTE: this isn't an FL_ITEM so it doesn't get the special treatment in DropToFloor_QC()
if (!this.noalign)
- droptofloor(this);
+ DropToFloor_QC_DelayedInit(this);
settouch(this, item_key_touch);
}
wep.event_damage = physical_item_damage;
if(!wep.cnt)
- {
- // fix the spawn origin
- setorigin(wep, wep.origin + '0 0 1');
- droptofloor(wep);
- }
+ DropToFloor_QC_DelayedInit(wep);
wep.spawn_origin = wep.origin;
wep.spawn_angles = item.angles;
}
if(!(this.spawnflags & TSF_SUSPENDED))
- droptofloor(this);
+ DropToFloor_QC_DelayedInit(this);
this.netname = tur.netname;
load_unit_settings(this, 0);
#define ChangeYaw(e, ...) (__self = (e), builtin_ChangeYaw(__VA_ARGS__))
#define checkclient(e, ...) (__self = (e), builtin_checkclient(__VA_ARGS__))
-#ifndef SVQC
- #define droptofloor(e, ...) (__self = (e), builtin_droptofloor(__VA_ARGS__))
-#endif
+#define droptofloor(e, ...) (__self = (e), builtin_droptofloor(__VA_ARGS__))
#define error(...) (__self = (NULL), builtin_error(__VA_ARGS__))
#define movetogoal(e, ...) (__self = (e), builtin_movetogoal(__VA_ARGS__))
#define walkmove(e, ...) (__self = (e), builtin_walkmove(__VA_ARGS__))
// do item filtering according to game mode and other things
if (this.noalign <= 0)
{
- // note droptofloor returns false if stuck/or would fall too far
if (!this.noalign)
- droptofloor(this);
+ DropToFloor_QC_DelayedInit(this);
waypoint_spawnforitem(this);
}
#pragma once
-#undef droptofloor
#undef sound
var void delete_fn(entity e);
#pragma once
-#define droptofloor builtin_droptofloor
-
#define IT_SHOTGUN _IT_SHOTGUN /* BIT(0) */
#define IT_SUPER_SHOTGUN _IT_SUPER_SHOTGUN /* BIT(1) */
#define IT_NAILGUN _IT_NAILGUN /* BIT(2) */
setorigin(this, this.dropped_origin = this.origin);
}
-void droptofloor(entity this)
+void DropToFloor_QC_DelayedInit(entity this)
{
InitializeEntity(this, DropToFloor_QC, INITPRIO_DROPTOFLOOR);
}
void readlevelcvars();
.vector dropped_origin;
-void droptofloor(entity this);
+void DropToFloor_QC_DelayedInit(entity this);
IntrusiveList g_moveables;
STATIC_INIT(g_moveables) { g_moveables = IL_NEW(); }