void() NapalmTouch =
{
// stick
	local float tmp;
	tmp=pointcontents(self.origin);
	if (other!=world) // monster or player
	{
		self.velocity='0 0 0';
		self.avelocity='0 0 0';
		self.angles=vectoangles(other.velocity);
		self.think=NapalmThink;
		self.th_die=NapalmDie;
		self.health=1;
		self.takedamage=DAMAGE_AIM;
		self.chain=other;	// save target
		self.nextthink=time+0.1; // hopefully this is short enough
		self.avelocity='0 0 0';
		self.touch=SUB_Null;
		self.blasttimer=time+120;
		remove(self);
		return;
	}
	else if ((tmp==CONTENT_SKY)||(tmp==CONTENT_WATER)||(tmp==CONTENT_LAVA)||(tmp==CONTENT_SLIME))
	{
		remove(self);
		return;
	}
	else
	{
		self.velocity='0 0 0';
		self.avelocity='0 0 0';
		self.angles=vectoangles('0 0 0');
		self.think=SUB_Remove;
		self.touch=SUB_Null;
		self.th_die=NapalmDie2;
		self.nextthink=time+120;
	}
};

void() NapalmDie =
{
// light up
	local entity fire;
	fire=spawn();
	fire.owner=self.owner;
	fire.movetype=MOVETYPE_NONE;
	fire.solid=SOLID_NOT;
	fire.classname="napalmflame";
	fire.nextthink=time+0.1;
	fire.think=NapalmFlameThink;
	fire.effects=EF_BRIGHTLIGHT;
	fire.blasttimer=time+10;
	fire.view_ofs=self.view_ofs;
	fire.chain=self.chain;
	fire.style=0;
	fire.frame=0;
	setmodel(fire,"progs/flame2.mdl");
	setsize(fire,'0 0 0','0 0 0');
	setorigin(fire,self.origin+'0 0 16');
	remove(self);
};

void() NapalmDie2 =
{
// light up
	local entity fire;
	fire=spawn();
	fire.owner=self.owner;
	fire.movetype=MOVETYPE_NONE;
	fire.solid=SOLID_NOT;
	fire.classname="napalmflame";
	fire.nextthink=time+0.1;
	fire.think=FlameThink;
	fire.effects=EF_BRIGHTLIGHT;
	fire.blasttimer=time+10;
	fire.style=0;
	fire.frame=0;
	setmodel(fire,"progs/flame2.mdl");
	setsize(fire,'0 0 0','0 0 0');
	setorigin(fire,self.origin+'0 0 16');
	remove(self);
};

void() NapalmThink =
{
	local float tmp;
	tmp=pointcontents(self.origin);
	self.origin=self.chain.origin;
	self.angles=vectoangles(self.chain.velocity);
	self.nextthink=time+0.1;
	if (self.blasttimer<time)
		remove(self);
	if ((tmp==CONTENT_WATER)||(tmp==CONTENT_LAVA)||(tmp==CONTENT_SLIME))
		remove(self);
};
