entity e;
e = start;
funcPre(pass, e);
- while(e.downleft)
+ while (e.(downleft))
{
- e = e.downleft;
+ e = e.(downleft);
funcPre(pass, e);
}
funcPost(pass, e);
while(e != start)
{
- if(e.right)
+ if (e.(right))
{
- e = e.right;
+ e = e.(right);
funcPre(pass, e);
- while(e.downleft)
+ while (e.(downleft))
{
- e = e.downleft;
+ e = e.(downleft);
funcPre(pass, e);
}
}
else
- e = e.up;
+ e = e.(up);
funcPost(pass, e);
}
}
return valstr;
}
-float dotproduct(vector a, vector b)
-{
- return a.x * b.x + a.y * b.y + a.z * b.z;
-}
-
-vector cross(vector a, vector b)
-{
- return
- '1 0 0' * (a.y * b.z - a.z * b.y)
- + '0 1 0' * (a.z * b.x - a.x * b.z)
- + '0 0 1' * (a.x * b.y - a.y * b.x);
-}
-
// compressed vector format:
// like MD3, just even shorter
// 4 bit pitch (16 angles), 0 is -90, 8 is 0, 16 would be 90
}
#ifndef MENUQC
-vector healtharmor_maxdamage(float h, float a, float armorblock, float deathtype)
+vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype)
{
// NOTE: we'll always choose the SMALLER value...
float healthdamage, armordamage, armorideal;
return v;
}
-vector healtharmor_applydamage(float a, float armorblock, float deathtype, float damage)
+vector healtharmor_applydamage(float a, float armorblock, int deathtype, float damage)
{
vector v;
if (deathtype == DEATH_DROWN) // Why should armor help here...
return ((a * 22 + b) * 22 + c) * 22 + d;
}
-float lowestbit(int f)
+int lowestbit(int f)
{
f &= ~(f * 2);
f &= ~(f * 4);
// start with a 1-element queue
queue_start = queue_end = e;
- queue_end.fld = world;
+ queue_end.(fld) = world;
queue_end.FindConnectedComponent_processing = 1;
// for each queued item:
- for (; queue_start; queue_start = queue_start.fld)
+ for (; queue_start; queue_start = queue_start.(fld))
{
// find all neighbors of queue_start
entity t;
if(iscon(t, queue_start, pass))
{
// it is connected? ADD IT. It will look for neighbors soon too.
- queue_end.fld = t;
+ queue_end.(fld) = t;
queue_end = t;
- queue_end.fld = world;
+ queue_end.(fld) = world;
queue_end.FindConnectedComponent_processing = 1;
}
}
}
// unmark
- for(queue_start = e; queue_start; queue_start = queue_start.fld)
+ for (queue_start = e; queue_start; queue_start = queue_start.(fld))
queue_start.FindConnectedComponent_processing = 0;
}