self.move_angles = self.angles;
}
+ if(sf & ISF_SIZE)
+ {
+ self.mins_x = ReadCoord();
+ self.mins_y = ReadCoord();
+ self.mins_z = ReadCoord();
+ self.maxs_x = ReadCoord();
+ self.maxs_y = ReadCoord();
+ self.maxs_z = ReadCoord();
+ setsize(self, self.mins, self.maxs);
+ }
+
if(sf & ISF_STATUS) // need to read/write status frist so model can handle simple, fb etc.
{
self.ItemStatus = ReadByte();
if(sf & ISF_MODEL)
{
self.drawmask = MASK_NORMAL;
- self.movetype = MOVETYPE_NOCLIP;
+ self.movetype = MOVETYPE_TOSS;
self.draw = ItemDraw;
if(self.mdl)
if(sf & ISF_DROP)
{
self.gravity = 1;
- self.move_angles = '0 0 0';
+ //self.move_angles = '0 0 0';
self.move_movetype = MOVETYPE_TOSS;
self.move_velocity_x = ReadCoord();
self.move_velocity_y = ReadCoord();
WriteCoord(MSG_ENTITY, self.angles_z);
}
+ if(sf & ISF_SIZE)
+ {
+ WriteCoord(MSG_ENTITY, self.mins_x);
+ WriteCoord(MSG_ENTITY, self.mins_y);
+ WriteCoord(MSG_ENTITY, self.mins_z);
+ WriteCoord(MSG_ENTITY, self.maxs_x);
+ WriteCoord(MSG_ENTITY, self.maxs_y);
+ WriteCoord(MSG_ENTITY, self.maxs_z);
+ }
+
if(sf & ISF_STATUS)
WriteByte(MSG_ENTITY, self.ItemStatus);
e.SendFlags |= ISF_STATUS;
}
+void Item_Think()
+{
+ self.nextthink = time;
+ if(self.origin != self.oldorigin)
+ {
+ self.oldorigin = self.origin;
+ ItemUpdate(self);
+ }
+}
+
void Item_Respawn (void)
{
Item_Show(self, 1);
sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
setorigin (self, self.origin);
+ self.think = Item_Think;
+ self.nextthink = time;
+
//pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
pointparticles(particleeffectnum("item_respawn"), self.origin + 0.5 * (self.mins + self.maxs), '0 0 0', 1);
}
}
}
+void Item_RespawnThink()
+{
+ self.nextthink = time;
+ if(self.origin != self.oldorigin)
+ {
+ self.oldorigin = self.origin;
+ ItemUpdate(self);
+ }
+
+ if(time >= self.wait)
+ Item_Respawn();
+}
+
void Item_ScheduleRespawnIn(entity e, float t)
{
if((e.flags & FL_POWERUP) || (e.weapons & WEPSET_SUPERWEAPONS))
}
else
{
- e.think = Item_Respawn;
- e.nextthink = time + t;
+ e.think = Item_RespawnThink;
+ e.nextthink = time;
+ e.wait = time + t;
}
}
if(self.classname != "droppedweapon")
{
- self.think = func_null;
- self.nextthink = 0;
+ self.think = Item_Think;
+ self.nextthink = time;
if(self.waypointsprite_attached)
WaypointSprite_Kill(self.waypointsprite_attached);
setsize (self, '-16 -16 0', '16 16 48');
else
setsize (self, '-16 -16 0', '16 16 32');
+
+ self.SendFlags |= ISF_SIZE;
+
// note droptofloor returns FALSE if stuck/or would fall too far
droptofloor();
waypoint_spawnforitem(self);
}
setsize (self, self.pos1, self.pos2);
+ self.SendFlags |= ISF_SIZE;
+
if(itemflags & FL_POWERUP)
self.ItemStatus |= ITS_ANIMATE1;