if (validate_flags & TFL_TARGETSELECT_LOS)
{
v_tmp = real_origin(e_target) + ((e_target.mins + e_target.maxs) * 0.5);
- traceline(e_turret.tur_shotorg,v_tmp,0,e_turret);
+
+ traceline(e_turret.tur_shotorg, v_tmp, 0, e_turret);
if (e_turret.aim_firetolerance_dist < vlen(v_tmp - trace_endpos))
return -19;
v = gettaginfo(e,gettagindex(e,"tag_fire"));
if(v == '0 0 0')
{
- objerror("^1ERROR: Engine is borken! Turrets will NOT work. force g_turrets to 0 to run maps with turrets anyway.");
- crash();
+ //objerror("^1ERROR: Engine is borken! Turrets will NOT work. force g_turrets to 0 to run maps with turrets anyway.");
+ //crash();
}
setmodel(e,"");
csqc_shared = 0;
}
+ if not (self.spawnflags & TSF_SUSPENDED)
+ droptofloor_builtin();
+
// Terrainbase spawnflag. This puts a enlongated model
// under the turret, so it looks ok on uneaven surfaces.
if (self.spawnflags & TSF_TERRAINBASE)
float vz;
vector wish_angle,real_angle;
+ /*
+ if(self.enemy)
+ dprint("enemy!\n");
+ else
+ dprint("nothign =(!\n");
+ */
+
vz = self.velocity_z;
self.angles_x = anglemods(self.angles_x);
self.angles_y = (self.angles_y + real_angle_y);
// Simulate banking
- self.angles_z = bound(-45,real_angle_y * -2.5,45);
+ self.angles_z -= self.angles_z * frametime * 2;
+ self.angles_z = bound(-45,self.angles_z + ((real_angle_y * -25) * frametime),45);
if(self.enemy)
ewheel_move_enemy();
{
entity e;
- setorigin(self,self.pos1);
+ self.velocity = '0 0 0';
+ self.enemy = world;
+
+ setorigin(self, self.pos1);
if (self.target != "")
{
void ewheel_diehook()
{
- turret_trowgib2(self.origin,self.velocity + '0 0 400', '-0.6 -0.2 -02', self, 3 + time + random() * 2);
-
self.velocity = '0 0 0';
+ turret_trowgib2(self.origin, self.velocity + '0 0 400', '-0.6 -0.2 -02', self, 3 + time + random() * 2);
+
if (self.pathcurrent)
pathlib_deletepath(self.pathcurrent.owner);
self.pathcurrent = world;
-
- /*
- if (self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
- {
- verbstack_flush(self.verbs_move);
- remove(self.verbs_move);
- }
- */
-
}
void turret_ewheel_dinit()
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
- setsize(self,'-32 -32 0', '32 32 48');
+ setsize(self, '-32 -32 0', '32 32 48');
+ self.idle_aim = '0 0 0';
self.pos1 = self.origin;
- self.idle_aim = '0 0 0';
-
// Our fire routine
self.turret_firefunc = ewheel_attack;
self.turret_postthink = ewheel_postthink;
self.tur_head.aim_speed = cvar("g_turrets_unit_ewheel_turnrate");
self.tur_head.aim_speed = self.tur_head.aim_speed / (1 / self.ticrate);
+ if (!turret_tag_setup())
+ dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
+
+ //setorigin(self,self.origin + '0 0 128');
if (self.target != "")
{
e = find(world,targetname,self.target);
dprint("Warning: not a turrret path\n");
else
{
- self.pathcurrent = WALKER_PATH(self.origin,e.origin);
+ self.pathcurrent = WALKER_PATH(self.origin, e.origin);
self.pathgoal = e;
}
}
precache_model ("models/turrets/ewheel-base2.md3");
precache_model ("models/turrets/ewheel-gun1.md3");
+ precache_model ("models/pathlib/goodsquare.md3");
+ precache_model ("models/pathlib/badsquare.md3");
+ precache_model ("models/pathlib/square.md3");
+
turret_ewheel_loadcvars();
self.think = turret_ewheel_dinit;