void(entity targ,entity inflictor,entity attacker,float dmg) T_Damage;
void(float dmg) spawn_touchblood;

float(float a, float b) min = {
	if (a>b) 
		return b; 
	else 
		return a;
};

void() ShrapnelTouch = 
{
	if (other.solid == SOLID_TRIGGER)
		return;
	if (pointcontents(self.origin) == CONTENT_SKY)
	{
		remove(self);
		return;
	}
	if (other.takedamage)
	{
		spawn_touchblood(20);
		T_Damage(other,self,self.owner,20);
	}
	else
	{
		WriteByte(MSG_BROADCAST,SVC_TEMPENTITY);
		WriteByte(MSG_BROADCAST,TE_SUPERSPIKE);
		WriteCoord(MSG_BROADCAST,self.origin_x);
		WriteCoord(MSG_BROADCAST,self.origin_y);
		WriteCoord(MSG_BROADCAST,self.origin_z);
	}
	remove(self);
};
