#if defined(SVQC)
- #include "../server/bot/bot.qh"
- #include "../server/bot/waypoints.qh"
+ #include "../server/bot/api.qh"
#include <server/mutators/all.qh>
#ifdef CSQC
bool autocvar_cl_ghost_items_vehicle = true;
+.vector item_glowmod;
void Item_SetAlpha(entity this)
{
bool veh_hud = (hud && autocvar_cl_ghost_items_vehicle);
if(!veh_hud && (this.ItemStatus & ITS_AVAILABLE))
{
this.alpha = 1;
- this.colormod = this.glowmod = '1 1 1';
+ this.colormod = '1 1 1';
+ this.glowmod = this.item_glowmod;
}
else
{
if(sf & ISF_MODEL)
{
this.drawmask = MASK_NORMAL;
- this.move_movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
if (isnew) IL_PUSH(g_drawables, this);
this.draw = ItemDraw;
this.solid = SOLID_TRIGGER;
else
{
this.draw = ItemDraw;
- LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it\n");
+ LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it");
}
}
if(this.mdl == "")
- LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, ", tell tZork about this!\n");
+ LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, ", tell tZork about this!");
precache_model(this.mdl);
_setmodel(this, this.mdl);
}
if(sf & ISF_COLORMAP)
+ {
this.colormap = ReadShort();
+ this.item_glowmod_x = ReadByte() / 255.0;
+ this.item_glowmod_y = ReadByte() / 255.0;
+ this.item_glowmod_z = ReadByte() / 255.0;
+ }
if(sf & ISF_DROP)
{
this.gravity = 1;
this.pushable = true;
//this.angles = '0 0 0';
- this.move_movetype = MOVETYPE_TOSS;
+ set_movetype(this, MOVETYPE_TOSS);
this.velocity_x = ReadCoord();
this.velocity_y = ReadCoord();
this.velocity_z = ReadCoord();
WriteShort(MSG_ENTITY, this.fade_start);
if(this.mdl == "")
- LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, "exspect a crash just aboute now\n");
+ LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, "expect a crash just about now");
WriteString(MSG_ENTITY, this.mdl);
}
if(sf & ISF_COLORMAP)
+ {
WriteShort(MSG_ENTITY, this.colormap);
+ WriteByte(MSG_ENTITY, this.glowmod.x * 255.0);
+ WriteByte(MSG_ENTITY, this.glowmod.y * 255.0);
+ WriteByte(MSG_ENTITY, this.glowmod.z * 255.0);
+ }
if(sf & ISF_DROP)
{
//setmodel(e, "null");
e.solid = SOLID_NOT;
e.colormod = '0 0 0';
- e.glowmod = e.colormod;
+ //e.glowmod = e.colormod;
e.spawnshieldtime = 1;
e.ItemStatus &= ~ITS_AVAILABLE;
}}
{
if (ITEM_TOUCH_NEEDKILL())
{
- remove(this);
+ delete(this);
return;
}
}
_sound (toucher, (this.itemdef.instanceOfPowerup ? CH_TRIGGER_SINGLE : CH_TRIGGER), (this.item_pickupsound ? this.item_pickupsound : Sound_fixpath(this.item_pickupsound_ent)), VOL_BASE, ATTEN_NORM);
if (this.classname == "droppedweapon")
- remove (this);
+ delete (this);
else if (this.spawnshieldtime)
{
entity e;
if(this.effects & EF_NODRAW)
{
// marker for item team search
- LOG_TRACE("Initializing item team ", ftos(this.team), "\n");
+ LOG_TRACE("Initializing item team ", ftos(this.team));
RandomSelection_Init();
FOREACH_ENTITY_FLOAT(team, this.team,
{
{
if(wasfreed(this) || !this) { return; }
Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
- remove(this);
+ delete(this);
}
// pickup evaluation functions
if(MUTATOR_CALLHOOK(FilterItem, this)) // error means we do not want the item
{
startitem_failed = true;
- remove(this);
+ delete(this);
return;
}
if (trace_dpstartcontents & DPCONTENTS_NODROP)
{
startitem_failed = true;
- remove(this);
+ delete(this);
return;
}
}
if(!have_pickup_item(this))
{
startitem_failed = true;
- remove (this);
+ delete (this);
return;
}
// why not flags & fl_item?
FOREACH_ENTITY_RADIUS(this.origin, 3, it.is_item, {
LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(this.origin));
- LOG_TRACE(" vs ", it.netname, vtos(it.origin), "\n");
+ LOG_TRACE(" vs ", it.netname, vtos(it.origin));
error("Mapper sucks.");
});
this.is_item = true;
this.gravity = 1;
if (!(this.spawnflags & 1024))
this.ItemStatus |= ITS_ANIMATE1;
- this.ItemStatus |= ISF_COLORMAP;
+ this.SendFlags |= ISF_COLORMAP;
}
this.state = 0;
if (MUTATOR_CALLHOOK(Item_Spawn, this))
{
startitem_failed = true;
- remove(this);
+ delete(this);
return;
}
}
if(actor.classname == "droppedweapon")
{
EXACTTRIGGER_TOUCH(this, trigger);
- remove(actor);
+ delete(actor);
return;
}
FOREACH_ENTITY_ENT(enemy, actor,
{
if(it.classname == "droppedweapon")
- remove(it);
+ delete(it);
});
if(GiveItems(actor, 0, tokenize_console(this.netname)))