return world;
}
-float tile_check_cross(vector where)
-{SELFPARAM();
+float tile_check_cross(entity this, vector where)
+{
vector p,f,r;
f = PLIB_FORWARD * tile_check_size;
// forward-right
p = where + f + r;
- traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+ traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
if (!location_isok(trace_endpos, 1, 0))
return 0;
// Forward-left
p = where + f - r;
- traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+ traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
if (!location_isok(trace_endpos, 1, 0))
return 0;
// Back-right
p = where - f + r;
- traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+ traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
if (!location_isok(trace_endpos, 1 ,0))
return 0;
//Back-left
p = where - f - r;
- traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+ traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
if (!location_isok(trace_endpos, 1, 0))
return 0;
return 1;
}
-float tile_check_plus(vector where)
-{SELFPARAM();
+float tile_check_plus(entity this, vector where)
+{
vector p,f,r;
f = PLIB_FORWARD * tile_check_size;
// forward
p = where + f;
- traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+ traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
if (!location_isok(trace_endpos,1,0))
return 0;
//left
p = where - r;
- traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+ traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
if (!location_isok(trace_endpos,1,0))
return 0;
// Right
p = where + r;
- traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+ traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
if (!location_isok(trace_endpos,1,0))
return 0;
//Back
p = where - f;
- traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+ traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
if (!location_isok(trace_endpos,1,0))
return 0;
return 1;
}
-float tile_check_plus2(vector where)
-{SELFPARAM();
+float tile_check_plus2(entity this, vector where)
+{
vector p,f,r;
float i = 0, e = 0;
// forward
p = where + f;
- traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+ traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
if (location_isok(trace_endpos,1,0))
{
++i;
//left
p = where - r;
- traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+ traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
if (location_isok(trace_endpos,1,0))
{
++i;
// Right
p = where + r;
- traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+ traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
if (location_isok(trace_endpos,1,0))
{
++i;
//Back
p = where - f;
- traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,self);
+ traceline(p+tile_check_up,p-tile_check_down,MOVE_WORLDONLY,this);
if (location_isok(trace_endpos,1,0))
{
++i;
// forward-right
p = where + f + r;
- traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+ traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
if (location_isok(trace_endpos, 1, 0))
{
++i;
// Forward-left
p = where + f - r;
- traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+ traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
if (location_isok(trace_endpos, 1, 0))
{
++i;
// Back-right
p = where - f + r;
- traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+ traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
if (location_isok(trace_endpos, 1 ,0))
{
++i;
//Back-left
p = where - f - r;
- traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, self);
+ traceline(p + tile_check_up, p - tile_check_down, MOVE_WORLDONLY, this);
if (location_isok(trace_endpos, 1, 0))
{
++i;
return e;
}
-float tile_check_star(vector where)
+float tile_check_star(entity this, vector where)
{
- if(tile_check_plus(where))
- return tile_check_cross(where);
+ if(tile_check_plus(this, where))
+ return tile_check_cross(this, where);
return 0;
}